X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpage%2FPage.java;h=d26da79e0e72c8ba61b03da7c9f84c2191154fe4;hb=356a84e5ec2bb0936b7d1cdc635f7f051788da6a;hp=7a9b281f90ccce4167ec1ca3ded4c11433fda5c9;hpb=d2387116fcb86f0bc77286d501d095faaffce91b;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/page/Page.java b/src/main/java/net/pterodactylus/sone/web/page/Page.java index 7a9b281..d26da79 100644 --- a/src/main/java/net/pterodactylus/sone/web/page/Page.java +++ b/src/main/java/net/pterodactylus/sone/web/page/Page.java @@ -125,7 +125,7 @@ public interface Page { * * @return The accessed URI */ - public URI getURI() { + public URI getUri() { return uri; } @@ -307,6 +307,23 @@ public interface Page { } /** + * Sets the HTTP header with the given name to the given value. Multiple + * headers with the same name are not implemented so that latest call to + * {@link #setHeader(String, String)} determines what is sent to the + * browser. + * + * @param name + * The name of the header + * @param value + * The value of the header + * @return This response + */ + public Response setHeader(String name, String value) { + headers.put(name, value); + return this; + } + + /** * Returns the content of the response body. May be {@code null} if the * response does not have a body. *