Edit this page

up.protocol X-Up-Accept-Layer
HTTP header

The server may set this response header to accept the targeted overlay in response to a fragment update.

Upon seeing the header, Unpoly will cancel the fragment update and accept the layer instead. If the root layer is targeted, the header is ignored and the fragment is updated with the response's HTML content.

The header value is the acceptance value serialized as a JSON object. To accept an overlay without value, set the header value to the string null.

Example

The response below will accept the targeted overlay with the value {user_id: 1012 }:

Content-Type: text/html
X-Up-Accept-Layer: {"user_id": 1012}

<html>
  ...
</html>

Rendering content

The response may contain text/html content. If the root layer is targeted, the X-Up-Accept-Layer header is ignored and the fragment is updated with the response's HTML content.

If you know that an overlay will be closed don't want to render HTML, have the server change the render target to :none:

Content-Type: text/html
X-Up-Accept-Layer: {"user_id": 1012}
X-Up-Target: :none
This website uses cookies to improve usability and analyze traffic.
I accept or learn more