-
-
Notifications
You must be signed in to change notification settings - Fork 114
Description
What is the problem this feature will solve?
We (Kong) experience some issues with Ada forcibly normalising data. While I agree that it is in general good thing to do and expected, and according to W3C spec, this causes some issues.
For example sometimes our Gateway needs to remove a single search parameter from the request url. This is most of the time good, but for some it causes issues. We would like to have mode/function or something to just remove the search parameter that we want to remove and leave rest intact. Issues that we have seen with just removing a single search parameter:
- incoming
%20gets converted to+. - some get encoded, e.g.
,when original search parameters had it non-encoded gets encoded when we remove different search parameter and get the final search string.
What is great with Ada btw. is that at least it retains the original order of parameters when manipulating them!
I am using removal of search parameter as an example here, but this may be useful in other manipulations as well. E.g. adding a new search parameter, and keep rest in their original form. Perhaps outside search parameters too.
I do understand that this may be a stretch to Ada, but it would probably make it a bit more general purpose (or granular) without violating too much anything. Please close this if you consider this something that Ada should not do.
What is the feature you are proposing to solve the problem?
Some possibilities are:
- provide API that tells positions where parameter starts and ends (indices) on incoming url (so that we can remove that on our own easily with simple string manipulation). Possibility for same parameter appearing multiple times can be solved by calling this multiple times (and always returning the left most indices).
- provide APIs, parameters, options that do non-changing removals etc.
- provide a way to disable normalization
What alternatives have you considered?
Alternative for us is to implement our own parsing logic to do this or fork / patch Ada (or refuse to change the behavior).