-
Notifications
You must be signed in to change notification settings - Fork 123
add response decompression support #86
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
Conversation
@tomerd build fails with |
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.
this needs a limit on the decompression threshold so denial of service attacks are harder. Just chatted to @Lukasa who actually has experience writing HTTP clients. We should either have a (configurable) limit of say a maximum of 32 MB or something or alternatively a maximum decompression threshold so for example: The decompressed data must not be more than 100x the size of the compressed data.
} | ||
} | ||
|
||
public mutating func inflatePart(to buffer: inout ByteBuffer) { |
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.
This API must not be public, as it is extremely unsafe. Please make it private.
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.
Fixed, thanks!
} | ||
|
||
let rc = CNIOExtrasZlib_inflateInit2(&self.stream, window) | ||
precondition(rc == Z_OK, "Unexpected return from zlib init: \(rc)") |
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.
This should probably throw.
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.
fixed, thanks!
@artemredkin add |
…nternal or private
@tomerd @Lukasa @weissi I've updated the PR with the latests changes from |
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.
Basically LGTM.
@weissi are you happy with the latest changes? |
…ver/async-http-client into support_response_decompression
@weissi ready for review |
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.
@artemredkin sorry for the delay! LGTM
fixes #44