Answer the question
In order to leave comments, you need to log in
Why is EPIPE Koa js thrown out when redirecting?
Good afternoon, you need to make a redirect for SSR to Koa.js.
Conditions for a redirect, if the user went to the main page from a qver, for example, site.ru/?test, then there will be a redirect to the main site.ru.
Everything works fine on the locale, but on the test it crashes with an error:
Component code:
https://pastebin.com/3SHxjWR2
The
redirect is done from lines 29-32. I check if there is a queristring, if there is, then I redirect to the main one.
According to this log from the test, then it enters the condition (mk 2 log console)
Please tell me where to dig? I do not quite understand the essence of the epipe error
Answer the question
In order to leave comments, you need to log in
So, added return and everything worked on the test
console.log(ctx.request.query, ctx.request.querystring);
if (ctx.request.querystring && ctx.request.querystring !== 'auth-need') {
console.log(ctx.request.query, ctx.request.querystring);
ctx.redirect('/');
return;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question