Polyman Documentation - v3.1.0
    Preparing search index...

    Function urlBelongsTo

    • True when url is the base URL or a path under it: same scheme, host and port, and a path that starts at a / boundary of the base path. A key is only sent when this is true for its own preset.

      Parameters

      • baseUrl: string
      • url: string

      Returns boolean

      urlBelongsTo('https://api.openai.com/v1', 'https://api.openai.com/v1/models'); // true
      urlBelongsTo('https://api.openai.com/v1', 'https://api.openai.com.evil.io/v1'); // false