Open antony66 opened 7 years ago
ngx.unescape_uri() would decode '+' to whitespace. Here is a discription on wikipedia. https://en.wikipedia.org/wiki/Percent-encoding#The_application.2Fx-www-form-urlencoded_type
It is expected that ngx.unescape_uri()
would decode back a string encoded by nginx. It doesn't happen correctly.
@antony66 It meet our expecation. As @qlee001 says, the real percent encoding uses %20 while form data in URLs is in a modified form that uses +. And the codebase had point out this.
Plus should be converted to %0B, and then back to plus. Now look at what lua shows as incoming http_auth_pass
I am not sure if this is resty bug or nginx bug, but here's how to reproduce it:
Here's what you get in error.log:
So instead of "ca ffe+19" one would get back "ca ffe 19" where plus char is replaced with space.