wsd: Echo back port number in CSP too if found in Referer header
Otherwise, WOPI implementations that use non-standard ports get CSP voilation errors in the browsers because Poco's URI::getHost() method strips the port number from the host. No harm in mentioning the port number always even if its a standard one, so always use Poco::URI::getPort() to append the port to the frame ancestor. Change-Id: I9e7a7021b38f717e14af3d389e30f24ecaf6d122
This commit is contained in:
parent
8cbcf9a41a
commit
4ef373ce5f
1 changed files with 2 additions and 1 deletions
|
@ -507,7 +507,8 @@ void FileServerRequestHandler::preprocessFile(const HTTPRequest& request, Poco::
|
|||
Poco::URI uriFrameAncestor(frameAncestor);
|
||||
if (!frameAncestor.empty() && !uriFrameAncestor.getScheme().empty() && !uriFrameAncestor.getHost().empty())
|
||||
{
|
||||
frameAncestor = uriFrameAncestor.getScheme() + "://" + uriFrameAncestor.getHost();
|
||||
frameAncestor = uriFrameAncestor.getScheme() + "://" + uriFrameAncestor.getHost() + ":" + std::to_string(uriFrameAncestor.getPort());
|
||||
|
||||
LOG_TRC("Final frame ancestor: " << frameAncestor);
|
||||
|
||||
// Replaced by frame-ancestors in CSP but some oldies don't know about that
|
||||
|
|
Loading…
Reference in a new issue