cedadev / archive-opensearch

Prototype Opensearch Application for the CEDA Archive
0 stars 0 forks source link

Make url work if you don't URL encode the + symbol #17

Closed rsmith013 closed 4 years ago

rsmith013 commented 4 years ago

At the moment, if you include the httpAccept parameter in your request you have to manually URL encode the + character. + becomes %2B.

See if there is a way that you could supply the response type using the + symbol so your parameter becomes httpAccept=application/geo+json instead of httpAccept=application/geo%2Bjson

philipkershaw commented 4 years ago

I don't think you can do this with HTTP URIs. However, clients can use '+' with HTTP header using content negotiation

rsmith013 commented 4 years ago

The characters ! $ & ' ( ) * + , ; = are permitted by generic URI syntax to be used unencoded in the user information, host, and path as delimiters.

I'll put it low on the priority list but might be worth 15mins just to check.

philipkershaw commented 4 years ago

Yes, RFC says: The purpose of reserved characters is to provide a set of delimiting characters that are distinguishable from other data within a URI. URIs that differ in the replacement of a reserved character with its corresponding percent-encoded octet are not equivalent. Percent- encoding a reserved character, or decoding a percent-encoded octet that corresponds to a reserved character, will change how the URI is interpreted by most applications. Thus, characters in the reserved set are protected from normalization and are therefore safe to be used by scheme-specific and producer-specific algorithms for delimiting data subcomponents within a URI.

... so you can do it but it's modifying the semantics a little. Best method is content negotiation through the HTTP header IMOP.

rsmith013 commented 4 years ago

ok, i'll close this then.