-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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(plugins) removing ngx.req.raw_header() for HTTP/2 compatibility #2540
Conversation
spec/03-plugins/09-galileo/ngx.lua
Outdated
return "GET /request/path HTTP/1.1\r\n".. | ||
"Host: mockbin.com\r\n".. | ||
"Accept: application/json\r\n".. | ||
"Accept: application/x-www-form-urlencoded\r\n\r\n\r\n" |
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.
Required to avoid double escaping of \r
.
kong/plugins/galileo/alf.lua
Outdated
size = size + #k + 2 + #tostring(y) + 2 --First 2 is semicolon + space | ||
end | ||
else | ||
size = size + #k + 1 + 1 + #tostring(v) + 2 --First 2 is semicolon + space |
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.
why 1 + 1 instead 2? what makes it different from line 90?
kong/plugins/galileo/alf.lua
Outdated
size = size + #k + 1 + 1 + #tostring(v) + 2 --First 2 is semicolon + space | ||
end | ||
end | ||
return #request_line + 2 + size + 4 -- 2 it's \r\n, 4 it's trailing \r\n\r\n |
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.
I think you already counting one \r\n
when you calculating the size of last header, so should't the final sum be like
#request_line + 2 + size + 2
Updated. |
f74dd07
to
9364f31
Compare
(fixed merge conflict and squashed) |
ngx.req.raw_header()
invocation calls.