Skip to content

endpointCompression url construction issue #13900

@mergut

Description

@mergut

When gzip compression is enabled, the following code fails if prebid is running inside a friendly iframe (location.origin is 'null').

The main issue here is that "request.url" is an absolute url so the second parameter to URL constructor is irrelevant, should be removed.

const url = new URL(request.url, window.location.origin);

Affects version 9 and 10.

From URL documentation:

url parameter:
A string or any other object with a stringifier that represents an absolute URL or a relative reference to a base URL. If url is a relative reference, base is required, and is used to resolve the final URL. If url is an absolute URL, a given base will not be used to create the resulting URL.

https://developer.mozilla.org/en-US/docs/Web/API/URL/URL

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions