Error "Value must be BASE64 encoded" with some specific URL when Handler redirects on portal
I had a strange bug with Handler, occuring only with some URLs.
I found this was because Base64 encoding could generate +
characters in the value, and with the new portal code using PSGI, URL decoding replaces +
by space, and the portal returns a "Bad URL" error.
We can reproduce with: https://courriel.example.fr/service/home/~/
==> /var/log/httpd/error_log <==
[Fri May 22 16:01:52 2020] [LLNG:29701] [error] Value must be BASE64 encoded (param: url | value: aHR0cHM6Ly9jb3VycmllbC5leGFtcGxlLmZyL3NlcnZpY2UvaG9tZS9 Lw==)
==> /var/log/httpd/access_log <==
1.1.1.1 - - [22/May/2020:16:01:52 +0200] "GET /?url=aHR0cHM6Ly9jb3VycmllbC5leGFtcGxlLmZyL3NlcnZpY2UvaG9tZS9+Lw== HTTP/1.1" 200 1526 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
To fix it, Handler must URL encode the url value.