spiegel-keyman/common/windows/delphi/web
Marc Durdin 6eefb3a771 fix(developer): EncodeURL was not handling spaces
Fixes #7810.

This addresses a regression introduced in #7631, where URL parameters
with spaces would be encoded into `+` instead of `%20`. Looking a bit
deeper at the Delphi `TNetEncoding.URL.Encode` function I realised that
it was entirely inadequate. Some guy named Marc Durdin wrote a blog a
good few years ago about the problem, and that's what I ended up using.

This encoding issue caused filenames with spaces (by default, project
paths in Developer have spaces) to give a 404 when editing a touch
layout, which meant that the touch keyboards could not be saved.

Also fixes KEYMAN-DEVELOPER-74, where the + encoding caused multiple
entries to appear in the filename cache.

Amusing to Google this problem, find solid answer on SO, which pointed
to my very own blog. Embarrassing that my own code didn't already
include my own fix.

A secondary issue is also fixed here, where request parameters were
double-decoded for formencoded POST requests. The fix for broken URL
encodings was only required for GET requests.

This also showed up in KEYMAN-DEVELOPER-74, with double-encoded paths
being registered as source files.
2022-11-26 07:09:53 +07:00
..
Keyman.System.HttpServer.Base.pas fix(developer): EncodeURL was not handling spaces 2022-11-26 07:09:53 +07:00