This causes issues, at the least, with compressed messages that 'look' like
they decompressed body is form-encoded. 18385 messages in the last month
rejected due to this.
No actually valid form-encoded messages in that time frame.
We suspect no-one is actually using this possible form of upload, and
ideally would remove the code for it entirely. First we need to log any
uploaders that do use this form to be sure.
The CL arg won't actually *do* anything yet, because this script doesn't
actually have a logger set up at all. But we need to fake this else
eddn.conf.Settings.loadConfig() won't be called correctly or work.
Fixes the regression identified in #165
However the gzip code path can still erroneously think a decompressed
request body is form encoded when it is not. This happens when any text
in the decompressed body matches the regex:
.+=[^\&;]*
i.e. some text, followed by `=`, and then some more text, possibly
empty, followed by an ampersand `&`, or semi-colon `;`, or the end of the
string.
`&` and `;` are used to separate key=value pairs in form encoding, the
`=` separates a key from its value.
* This code worked if the request was *properly* form-encoded, with a
'data' key whose value was a valid message.
* It failed to detect where the request was form-encoded, with without a
'data' key. It would just assume 'not form-encoded' in that case, then
fail later on JSON parsing.
Thus, re-use the `urlparse.parse_qs()` check for form-encoded format.
This passes:
1. Properly, `data` key, form-encoded with valid value is fully JSON
parsed, schema checked and accepted.
2. *NOT* compressed *or* form-encoded valid message is properly parsed
and accepted.
2. Uncompressed, form-encoded, but no `data` key correctly returns the
same error status and body as the compressed+form-encoded+no data key
path.
For some reason the milliseconds portion of the %S timestamp is using a
comma for decimals separator, despite 'locale' saying we're set to (US)
English. /tableflip
Actually some logging was already there, just the logger had never been
set up properly, but then I decided to make the format of this message
more useful.