Character "= " into a query parameter. How to escape it?


I'm currently trying to route differently the web requests when an APIKey is given into the url with the parameter apikey. The api key ends with an = which is my problem.

Here what I use:

"$DOMAINNAME) && PathPrefix(/api) && Query(apikey, $tools_API_KEY)"

But I end up with this error: "mux: number of parameters must be multiple of 2"

This is working well if I test with an api key which does not contain =

Unfortunately, I cannot find a way to escape this "special" character to make my route works and I cannot change the API as it's given by a tool and will always ends with =.

Anyone knows how to deal with this case ?



the right syntax for the query parameter is Query(`api=aaa`)

But there is a bug if you try to do Query(`api=aa=a`), I fixed the bug in fix: query parameter matching with equal by ldez · Pull Request #9369 · traefik/traefik · GitHub

It will be a part of v2.8.6.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.