-
Notifications
You must be signed in to change notification settings - Fork 308
Make API case-insensitive #1648
Comments
Have never really used python before, but this would seem to be where the username in the slug were theoretically converted to lowercase to match the Could it be that we're not using DB docs ref:
EDIT: Ok, seems my second suggestion was baloney. |
Ah, I'm an idiot. It's because it redirects before it checks against lower... https://github.com/gittip/www.gittip.com/blob/master/gittip/utils/__init__.py#L310-L312 Maybe the redirect isn't needed? |
The https://github.com/gittip/www.gittip.com/blob/master/gittip/utils/__init__.py#L284-293 |
A robust HTTP client library should follow redirects, so technoweenie/node-scoped-http-client#7 should be fixed in any case, and that would take care of the presenting issue here. Whether or not to canonicalize URIs for API requests is complicated by the fact that we run both Why not just fix technoweenie/node-scoped-http-client#7, though? |
Totally. We can do that. But then every client lib implementation in every language will have to reimplement. I've never run into a 302 in regular API use, except in one really crufty API from some obscure service, and I don't think they're even in the same league as us. My experience is that 302's are usually used to get people onto https (in the context of API's :) Random selection of API's for popular services (and using non-numeric IDs): Anyhow, case-sensitivity is fine for us for now, but I'll scratch the itch when the time comes :) Thanks for the pointer on where to look! |
Copying convo from other thread (#1563):
|
+1 from @espadrine in working with gh-badges (node badge server we're using for Shields). IRC |
This SO answer points to https://github.com/mikeal/request :
|
So it looks like https://github.com/mikeal/request is a competitor of https://github.com/technoweenie/node-scoped-http-client, and Hubot uses the latter. |
I'm closing this as won't fix. HTTP redirects are not something esoteric. A proper client library should support them. |
@patcon As you say, for the record, this is github's disclaimer: http://developer.github.com/v3/#http-redirects
|
Forked from #1563 (comment)
Mis-cased usernames in the API are 302 redirected to the correct url when accessed via browser, but some request libs (particularly that used by hubot) don't support redirects.
Thinking might be best to handle this unexpected behaviour server-side. For the record, this is what github does.
cc: @balupton
The text was updated successfully, but these errors were encountered: