diff --git a/core/common/src/main/java/org/trellisldp/common/HttpConstants.java b/core/common/src/main/java/org/trellisldp/common/HttpConstants.java index 1aa043224..269c24f03 100644 --- a/core/common/src/main/java/org/trellisldp/common/HttpConstants.java +++ b/core/common/src/main/java/org/trellisldp/common/HttpConstants.java @@ -115,6 +115,9 @@ public final class HttpConstants { /** The name of the HTTP response code for a Precondition Required error. */ public static final int PRECONDITION_REQUIRED = 428; + /** The name of the HTTP request header indicating a browser's origin. */ + public static final String ORIGIN = "Origin"; + /** The name of the HTTP request header used to influence what information is included in responses. */ public static final String PREFER = "Prefer"; diff --git a/core/http/src/main/java/org/trellisldp/http/impl/GetHandler.java b/core/http/src/main/java/org/trellisldp/http/impl/GetHandler.java index 6bf646c0d..288356066 100644 --- a/core/http/src/main/java/org/trellisldp/http/impl/GetHandler.java +++ b/core/http/src/main/java/org/trellisldp/http/impl/GetHandler.java @@ -47,6 +47,7 @@ import static org.trellisldp.common.HttpConstants.ACCEPT_RANGES; import static org.trellisldp.common.HttpConstants.DESCRIPTION; import static org.trellisldp.common.HttpConstants.MEMENTO_DATETIME; +import static org.trellisldp.common.HttpConstants.ORIGIN; import static org.trellisldp.common.HttpConstants.PREFER; import static org.trellisldp.common.HttpConstants.PREFERENCE_APPLIED; import static org.trellisldp.common.HttpConstants.RANGE; @@ -391,6 +392,7 @@ private CompletionStage getBinaryStream(final IRI dsid, final Trell private String buildVaryHeader(final boolean isLdpRs) { final List variants = new ArrayList<>(); variants.add(ACCEPT); + variants.add(ORIGIN); if (!isMemento) { variants.add(ACCEPT_DATETIME); }