Skip to content
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

Multibyte character encoding issue with url rewrite #108

Open
ghost opened this issue Jun 26, 2015 · 2 comments
Open

Multibyte character encoding issue with url rewrite #108

ghost opened this issue Jun 26, 2015 · 2 comments

Comments

@ghost
Copy link

ghost commented Jun 26, 2015

I'm using URL rewrite function of http-master for my product.
There is no problem in single byte character for a request.
But, If I use multibyte character string at the URI path string, then it makes an encoding problems.

As a result, I had patched following codes in proxy.js.

var processed = regexpHelper(target.href, req.match);
processed = encodeURI(processed);

Then, Multibyte character issue was resolved.
But, I'm not sure how this code is appropriate for your code structure.

Could you please fix this issue?

@Rush
Copy link
Member

Rush commented Jun 26, 2015

Thanks for the report, I'll look into it. Can you provide some example URLs so that it can be tested?

@ghost
Copy link
Author

ghost commented Jun 26, 2015

The used routing table is as follow

 "192.168.137.2/fs/*": "127.0.0.1:5003/[1]",

original request in client is as follow:

http://192.168.137.2/fs/file/test/proj1/한글

it could be encoded by browser, and delivers to the server

http://192.168.137.2/fs/file/test/proj1/%ED%95%9C%EA%B8%80 

The processed variable in proxy.js after calling of regexpHelper would be get decoded string by express like this:

> http://192.168.137.2/file/test/proj1/한글

The first 'fs' is removed by regexpHelper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant