getOriginURL | WebHare Platform SDK
WebHare Platform SDK
    Preparing search index...

    Function getOriginURL

    • Reconstruct the client's URL based on a pathname and unforgable headers (Origin or Referer) and on requesturl otherwise (if it's not a browser invoking us)

      Parameters

      • req: SupportedRequestSubset

        Request object

      • pathname: string

        Local path as specified by app. Browsers should pass location.pathname. The URL may or may not start with a slash but may not be a full url.

      Returns null | string

      The pathname rebased to the actual origin URL or null if we couldn't safely determine it