You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add JRuby support for username and password parsing from urls #5
I currently have no idea how to parse username and password according to current http-parser.java implementation, I opened an issue to the author to see if he has any idea. a2800276/http-parser.java#5
@deepfryed according to a2800276/http-parser.java#5, username and password won't hit server, so I don't think http-parser-lite need to care about username and password.
Yes and no. http-parser is a simple request/response parser. So it needs to be able to parse the url and password in url to allow the application to create appropriate authorization headers if needed. e.g. in a proxy server
hmm, the problem is then you have something working while using MRI and not working in JRuby. This is not an API call that can raise NotImplemented error but will fail at the parser level when parsing urls with username and password. I don't think I like that even if explicitly documented :(
I'll see if i can hack some java code but I'm pretty busy at the moment and don't know when I can find some time to do it.
Activity
flyerhzm commentedon Mar 21, 2013
I currently have no idea how to parse username and password according to current http-parser.java implementation, I opened an issue to the author to see if he has any idea. a2800276/http-parser.java#5
flyerhzm commentedon Mar 22, 2013
@deepfryed according to a2800276/http-parser.java#5, username and password won't hit server, so I don't think http-parser-lite need to care about username and password.
deepfryed commentedon Mar 22, 2013
Yes and no. http-parser is a simple request/response parser. So it needs to be able to parse the url and password in url to allow the application to create appropriate authorization headers if needed. e.g. in a proxy server
flyerhzm commentedon Mar 22, 2013
I believe http clients / browsers will automatically wrap username and password into http authorization header, here is an example
deepfryed commentedon Mar 22, 2013
yeah, i get it. but not needed when you proxy.
GET https://foo:bar@example.org/hello
You could technically use http-parser-lite in implementing a proxy server. There is a reason why the C version has it :)
flyerhzm commentedon Mar 22, 2013
okay, would you mind ignoring username and password for jruby, just leaving a notice on README, saying only c extension support username and password?
deepfryed commentedon Mar 22, 2013
i'd love to have that supported in jruby as well, to keep the gotchas to minimum. is it too much work ?
flyerhzm commentedon Mar 24, 2013
seems not easy to implement, probably take a long time
deepfryed commentedon Mar 24, 2013
hmm, the problem is then you have something working while using MRI and not working in JRuby. This is not an API call that can raise NotImplemented error but will fail at the parser level when parsing urls with username and password. I don't think I like that even if explicitly documented :(
I'll see if i can hack some java code but I'm pretty busy at the moment and don't know when I can find some time to do it.