Example:
* both "session" and "session_P5000" cookies available: "session" value from "session_P5000"
* only "session" cookie available: "session" value from "session"
* only "session_P5000" cookie available: "session" value from "session_P5000"
Also added API docs regarding header encoding, incl support for RFC 5987
for filename fields in Content-Disposition headers in multipart/form-data
parts, incl. an example of an upload request with a utf-8 encoded filename.
Solves an issue with clients encoding filenames in multipart
headers in ISO-8859-1, causing an HTTP 500 response code.
This change makes ISO-8859-1 encoded headers work, sends
a 400 Bad Request instead of 500 Internal Server Error if the
request multipart headers cannot be decoded as either UTF-8
or ISO-8859-1, defines UTF-8 content type for multipart text
fields in rebuilt body and also adds support for RFC 5987 for the
multipart file upload "filename" header component.
* make sure server_port headers are properly set in reverse proxied scenarios
* overwrite request and response classes to
* always apply reverse proxy environment changes (so far missing for tornado
context)
* strip cookie name suffixes from cookie names on requests and
* be sure to set cookie name suffixes for cookie names on responses
* include script root in path used for cookies
* some minor refactoring in octoprint.server setup routines
* removed ReverseProxied class (didn't work for tornado context)
* add unit tests for the whole reverse proxy, request and response customization
(Let's be realistic here)
Introduced new "additionalNames" property on viewmodel declaration
to allow for registering alternative lookup names for a view model.
The freshly renamed FileViewModel now resolves as both "filesViewModel"
and "gcodeFilesViewModel", making the renaming backwards compatible
Documented all that stuff (and some more)
Removed unnecessary (and broken) call to event.preventDefault,
moved styles to less/css and also made sure to disable the buttons
not currently usable.
Most caching is left to the client, by utilizing ETag and Last-Modified headers.
Where it was easily achievable, an additional server side miniature cache of intermediary
results was introduced (e.g. for the files). The regular cached decorator was not used
since it targets caching full responses, and the responses in question already contained
client request specific data. Caching "one step earlier" allows better usage of the cache here.
Also introduced a dependency on the scandir module, to get a bit of a performance boost
on os.walk and os.listdir (which have been replaced with scandir.walk and scandir.listdir
respectively). See https://github.com/benhoyt/scandir#background on why that made
sense.