Skip to content

Directive: base uri

Ryan Parman edited this page Jun 14, 2024 · 10 revisions

Overview

The base-uri directive restricts the URLs that can be used to specify the document's base element.

Affects: <base>

Required reading:

Usage examples

Accepts one or more schemes or hosts, the 'self' keyword, or the 'none' keyword.

base-uri 'none'
base-uri 'self'
base-uri example.com
base-uri example.com example.org
base-uri https://*.example.com
base-uri https:

Fallbacks

base-uri does not fallback to default-src.

Possible errors

  • CSP-0100 — [ERROR] directive %s has an invalid value %s

For developers

ABNF (CSP3)

directive-name  = "base-uri"
directive-value = serialized-source-list

See ABNF: serialized-source-list

Type

References

Clone this wiki locally