public final class Origin extends Object
<scheme> "://" <hostname> [ ":" <port> ]
This class allows parsing of web urls and match against http headers that require such validation.
| Modifier and Type | Method and Description |
|---|---|
String |
encode() |
String |
host() |
static boolean |
isValid(String text)
Checks if the origin header is valid according to:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin
https://tools.ietf.org/html/rfc6454#section-7
|
static Origin |
parse(String text) |
int |
port() |
String |
protocol() |
String |
resource() |
boolean |
sameOrigin(String other) |
String |
toString() |
public static boolean isValid(String text)
public String protocol()
public String host()
public int port()
public String resource()
public boolean sameOrigin(String other)
public String encode()
Copyright © 2021. All rights reserved.