Skip to content

Commit

Permalink
Include a vary: origin header (#1273)
Browse files Browse the repository at this point in the history
  • Loading branch information
acoburn committed Mar 3, 2021
1 parent 13490a0 commit 9476d8c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -391,6 +392,7 @@ private CompletionStage<InputStream> getBinaryStream(final IRI dsid, final Trell
private String buildVaryHeader(final boolean isLdpRs) {
final List<String> variants = new ArrayList<>();
variants.add(ACCEPT);
variants.add(ORIGIN);
if (!isMemento) {
variants.add(ACCEPT_DATETIME);
}
Expand Down

0 comments on commit 9476d8c

Please sign in to comment.