Azure / azure-c-shared-utility

Azure C SDKs common code
Other
111 stars 203 forks source link

url decode not working for forms post that contain spaces. #645

Closed fmuntean closed 12 months ago

fmuntean commented 1 year ago

when trying to use the library to decode the url encoded string produced by a form post I get invalid string format. I think is because the SPACE character is not correctly supported.

ericwolz commented 1 year ago

please add more info

fmuntean commented 1 year ago

seems that is not supporting the '+' as a space. html forms encodes the space as a '+' instead of %20 and this library does not supports it. "URL encoding normally replaces a space with a plus (+) sign or with %20."

createDecodedString and calculateDecodedStringSize functions will need to be updated to handle the '+' character.

CIPop commented 12 months ago

Our library is a (partial) implementation of RFC 3986. This URI encoding is mandatory and must not change.

Our library does not support the encoding required by application/x-www-form-urlencoded which is different.

For a discussion on the subject, please see https://stackoverflow.com/questions/2678551/when-should-space-be-encoded-to-plus-or-20.

Closing as not supported, by design.