wsd: add http-headers unit-test

This is to defend the sneaking of extra http-headers
in the access_header URI param that was recently fixed.

Change-Id: Ic28cf58854847ac278bed8043f398b107f7992b3
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96862
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
This commit is contained in:
Ashod Nakashian
2020-06-22 08:24:11 -04:00
committed by Ashod Nakashian
parent 77aa816180
commit e68be80496
7 changed files with 159 additions and 6 deletions

View File

@ -668,6 +668,9 @@ void FileServerRequestHandler::preprocessFile(const HTTPRequest& request,
LOG_DBG("Preprocessing file: " << relPath);
std::string preprocess = *getUncompressedFile(relPath);
// We need to pass certain parameters from the loleaflet html GET URI
// to the embedded document URI. Here we extract those params
// from the GET URI and set them in the generated html (see loleaflet.html.m4).
HTMLForm form(request, message);
const std::string accessToken = form.get("access_token", "");
const std::string accessTokenTtl = form.get("access_token_ttl", "");