lbussy / LCBUrl

Arduino library for handling URLs
MIT License
7 stars 1 forks source link

Path extracted by getPath() could be rejected by case-conscientious web server #11

Closed sakurai-youhei closed 4 years ago

sakurai-youhei commented 4 years ago

The path is always converted to lower case at https://github.com/lbussy/LCBUrl/blob/1.1.0/src/LCBUrl.cpp#L391, however, the conversion causes rejection by some web servers such as Amazon S3.

Original URL https://example.com/Case/Sensitive/Path Current path given by getPath() case/sensitive/path Expected path given by getPath() Case/Sensitive/Path

lbussy commented 4 years ago

I understood rfc3986 to dictate that all components except for the password should be case insensitive on the server-side and rendered to lowercase when processing programatically. Whether that's right or not, you have a use case where this is causing an issue so let me see if 1) I'm mistaken and 2) if I can offer you at least a switch to preserve case.

lbussy commented 4 years ago

RFC7230 (draft) calls for the host and scheme to be normalized to lowercase and the path to be case-sensitive. I can't find a reason to not preserve the case. I'll see if I can get this in the dev branch tonight or tomorrow.

lbussy commented 4 years ago

It seemed fairly straightforward so I went ahead and merged to master. Thank you for bringing it up.