• HTTP
  • An overview of HTTP
  • Compression in HTTP
  • Redirections in HTTP
  • Connection management in HTTP/1.x
  • HTTP Client hints
  • Security and privacy
    1. Permissions Policy Experimental
    2. Headers
  • References
  • HTTP headers
    1. Accept-Language
    2. Access-Control-Allow-Credentials
    3. Access-Control-Expose-Headers
    4. Age
    5. Attribution-Reporting-Eligible Experimental
    6. Attribution-Reporting-Register-Source Experimental
    7. Attribution-Reporting-Register-Trigger Experimental
    8. Connection
    9. Content-DPR Non-standard Deprecated
    10. Content-Location
    11. Content-Type
    12. Critical-CH Experimental
    13. Date
    14. DNT Non-standard Deprecated
    15. Downlink Experimental
    16. DPR Non-standard Deprecated
    17. Early-Data Experimental
    18. ECT Experimental
    19. Expect-CT Deprecated
    20. Host
    21. If-Range
    22. Link
    23. NEL Experimental
    24. No-Vary-Search Experimental
    25. Observe-Browsing-Topics Experimental Non-standard
    26. Origin-Agent-Cluster Experimental
    27. Permissions-Policy Experimental
    28. Pragma Deprecated
    29. Range
    30. Report-To Non-standard Deprecated
    31. Reporting-Endpoints Experimental
    32. RTT Experimental
    33. Save-Data Experimental
    34. Sec-Browsing-Topics Experimental Non-standard
    35. Sec-CH-Prefers-Color-Scheme Experimental
    36. Sec-CH-Prefers-Reduced-Motion Experimental
    37. Sec-CH-Prefers-Reduced-Transparency Experimental
    38. Sec-CH-UA Experimental
    39. Sec-CH-UA-Arch Experimental
    40. Sec-CH-UA-Bitness Experimental
    41. Sec-CH-UA-Form-Factors Experimental
    42. Sec-CH-UA-Full-Version Deprecated
    43. Sec-CH-UA-Full-Version-List Experimental
    44. Sec-CH-UA-Mobile Experimental
    45. Sec-CH-UA-Model Experimental
    46. Sec-CH-UA-Platform Experimental
    47. Sec-CH-UA-Platform-Version Experimental
    48. Sec-CH-UA-WoW64 Experimental
    49. Sec-Fetch-User
    50. Sec-GPC Experimental
    51. Sec-WebSocket-Key
    52. Server-Timing
    53. Set-Cookie
    54. Set-Login Experimental
    55. Speculation-Rules Experimental
    56. Supports-Loading-Mode Experimental
    57. Tk Non-standard Deprecated
    58. Upgrade-Insecure-Requests
    59. Viewport-Width Non-standard Deprecated
    60. Warning Deprecated
    61. Width Non-standard Deprecated
    62. X-DNS-Prefetch-Control Non-standard
    63. X-Forwarded-For Non-standard
    64. X-Forwarded-Host Non-standard
    65. X-Forwarded-Proto Non-standard
    66. X-Permitted-Cross-Domain-Policies Non-standard
    67. X-Powered-By Non-standard
    68. X-Robots-Tag Non-standard
    69. X-XSS-Protection Non-standard Deprecated
  • HTTP request methods
    1. HEAD
    2. PUT
    3. 102 Processing
    4. 202 Accepted
    5. 206 Partial Content
    6. 300 Multiple Choices
    7. 304 Not Modified
    8. 401 Unauthorized
    9. 405 Method Not Allowed
    10. 409 Conflict
    11. 413 Content Too Large
    12. 417 Expectation Failed
    13. 423 Locked
    14. 428 Precondition Required
    15. 500 Internal Server Error
    16. 504 Gateway Timeout
    17. 508 Loop Detected
    18. CSP: block-all-mixed-content Deprecated
    19. CSP: fenced-frame-src Experimental
    20. CSP: frame-src
    21. CSP: object-src
    22. CSP: prefetch-src Non-standard Deprecated
    23. CSP: report-uri Deprecated
    24. CSP: require-trusted-types-for Experimental
    25. CSP: script-src-elem
    26. CSP: trusted-types Experimental
    27. Reason: CORS header 'Access-Control-Allow-Origin' does not match 'xyz'
    28. Reason: CORS request did not succeed
    29. Reason: Did not find method in CORS header 'Access-Control-Allow-Methods'
    30. Reason: missing token 'xyz' in CORS header 'Access-Control-Allow-Headers' from CORS preflight channel
    31. Permissions-Policy: accelerometer Experimental
    32. Permissions-Policy: ambient-light-sensor Experimental
    33. Permissions-Policy: attribution-reporting Experimental
    34. Permissions-Policy: autoplay Experimental
    35. Permissions-Policy: bluetooth Experimental
    36. Permissions-Policy: browsing-topics Experimental Non-standard
    37. Permissions-Policy: camera Experimental
    38. Permissions-Policy: compute-pressure Experimental
    39. Permissions-Policy: cross-origin-isolated Experimental
    40. Permissions-Policy: display-capture Experimental
    41. Permissions-Policy: document-domain Experimental
    42. Permissions-Policy: encrypted-media Experimental
    43. Permissions-Policy: fullscreen Experimental
    44. Permissions-Policy: gamepad Experimental
    45. Permissions-Policy: geolocation Experimental
    46. Permissions-Policy: gyroscope Experimental
    47. Permissions-Policy: hid Experimental
    48. Permissions-Policy: identity-credentials-get Experimental
    49. Permissions-Policy: idle-detection Experimental
    50. Permissions-Policy: local-fonts Experimental
    51. Permissions-Policy: magnetometer Experimental
    52. Permissions-Policy: microphone Experimental
    53. Permissions-Policy: midi Experimental
    54. Permissions-Policy: otp-credentials Experimental
    55. Permissions-Policy: payment Experimental
    56. Permissions-Policy: picture-in-picture Experimental
    57. Permissions-Policy: publickey-credentials-create Experimental
    58. Permissions-Policy: publickey-credentials-get Experimental
    59. Permissions-Policy: screen-wake-lock Experimental
    60. Permissions-Policy: serial Experimental
    61. Permissions-Policy: speaker-selection Experimental
    62. Permissions-Policy: storage-access Experimental
    63. Permissions-Policy: usb Experimental
    64. Permissions-Policy: web-share Experimental
    65. Permissions-Policy: window-management Experimental
    66. Permissions-Policy: xr-spatial-tracking Experimental
  • response header configures the current document's policy for loading and embedding cross-origin resources.

    The policy for whether a particular resource is embeddable cross-site may be defined for that resource using the CORS. If neither of these policies are set, then by default, resources can be loaded or embedded into a document as though they had a CORP value of cross-site.

    The Cross-Origin-Embedder-Policy allows you to require that CORP or CORS headers be set in order to load cross-site resources into the current document. You can also set the policy to keep the default behaviour, or to allow the resources to be loaded, but strip any credentials that might otherwise be sent. The policy applies to loaded resources, and resources in <iframe>s and nested frames.

    Note: The Cross-Origin-Embedder-Policy doesn't override or affect the embedding behaviour for a resource for which CORP or CORS has been set. If CORP restricts a resource to being embedded only same-origin, it won't be loaded cross-origin into a resource irrespective of the COEP value.

    Header type Response header
    Forbidden response header name No
  • Syntax

    http
    Cross-Origin-Embedder-Policy: unsafe-none | require-corp | credentialless
    

    Directives

    unsafe-none

    Allows the document to load cross-origin resources without giving explicit permission through the CORS protocol or the Cross-Origin-Resource-Policy header. This is the default value.

    require-corp

    A document can only load resources from the same origin, or resources explicitly marked as loadable from another origin.

    Cross-origin resource loading will be blocked by COEP unless:

    • The resource is requested in no-cors mode and the response includes a Cross-Origin-Resource-Policy header that allows it to be loaded into the document origin.
    • The resource is requested in cors mode and the resource supports and is permitted by CORS. This can be done, for example, in HTML using the {mode="cors"}.
    credentialless

    A document can load cross-origin resources that are requested in Cross-Origin-Resource-Policy header. In this case requests are sent without credentials: cookies are omitted in the request, and ignored in the response.

    The cross-origin loading behaviour for other request modes is the same as for require-corp. For example, a cross-origin resource requested in cors mode must support (and be permitted by) CORS.

    Examples

    Features that depend on cross-origin isolation

    Certain features, such as access to cross-origin isolated.

    To use these features in a document, you will need to set the COEP header with a value of require-corp or credentialless, and the Cross-Origin-Opener-Policy header to same-origin. In addition the feature must not be blocked by Permissions-Policy: cross-origin-isolated.

    http
    Cross-Origin-Opener-Policy: same-origin
    Cross-Origin-Embedder-Policy: require-corp
    

    You can use the WorkerGlobalScope.crossOriginIsolated properties to check if the features are restricted in window and worker contexts, respectively:

    js
    const myWorker = new Worker("worker.js");
    
    if (crossOriginIsolated) {
      const buffer = new SharedArrayBuffer(16);
      myWorker.postMessage(buffer);
    } else {
      const buffer = new ArrayBuffer(16);
      myWorker.postMessage(buffer);
    }
    

    Avoiding COEP blockage with CORS

    If you enable COEP using require-corp and want to embed a cross origin resource that supports CORS, you will need to explicitly specify that it is requested in cors mode.

    For example, to fetch an image declared in HTML from a third-party site that supports CORS, you can use the crossorigin attribute so that it is requested in cors mode:

    html
    <img src="/cats-d8c4vu/thirdparty.com/img.png" crossorigin />
    

    You can similarly use the HTMLScriptElement.crossOrigin attribute or fetch with { mode: 'cors' } to request a file in CORS mode using JavaScript.

    If CORS is not supported for some images, a COEP value of credentialless can be used as an alternative to load the image without any explicit opt-in from the cross-origin server, at the cost of requesting it without cookies.

    Specifications

    Specification
    HTML
    # coep

    Browser compatibility

    BCD tables only load in the browser

    See also