-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor!: new implementation #77
Conversation
dffe957
to
70739d3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this!
It lgtm overall
I am thinking do we need to provide similar utilities like the current function pipe(send, res) {
switch(send.statusCode) {
case 304: {
// remove Content-* headers
res.removeHeader('Content-Encoding')
res.removeHeader('Content-Language')
res.removeHeader('Content-Length')
res.removeHeader('Content-Range')
res.removeHeader('Content-Type')
break
}
}
res.writeHead(send.statusCode, send.headers)
send.stream.pipe(res)
} |
We can now remove http-errors as dependency :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove http-errors as dependency ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@climba03003 do you have time to refactor |
Fixes #15
There is problem I faced in handling
304
, Node.js will filled with un-wanted headers.So, the test need to remove some assertion on the removal of headers.
Checklist
npm run test
andnpm run benchmark
and the Code of conduct