mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-21 04:57:18 +02:00
add support for TCP routes (#1695)
This commit is contained in:
parent
64816720c8
commit
ad828c6e84
7 changed files with 86 additions and 13 deletions
|
@ -153,7 +153,7 @@ allowed_route_regex(input_url_obj, policy) {
|
|||
|
||||
parse_url(str) = { "scheme": scheme, "host": host, "path": path } {
|
||||
[_, scheme, host, rawpath] = regex.find_all_string_submatch_n(
|
||||
`(?:(http[s]?)://)?([^/]+)([^?#]*)`,
|
||||
`(?:((?:tcp[+])?http[s]?)://)?([^/]+)([^?#]*)`,
|
||||
str, 1)[0]
|
||||
path = normalize_url_path(rawpath)
|
||||
}
|
||||
|
|
|
@ -301,6 +301,13 @@ test_parse_url {
|
|||
url.path == "/some/path"
|
||||
}
|
||||
|
||||
test_parse_tcp_url {
|
||||
url := parse_url("tcp+http://example.com/some/path?qs")
|
||||
url.scheme == "tcp+http"
|
||||
url.host == "example.com"
|
||||
url.path == "/some/path"
|
||||
}
|
||||
|
||||
test_allowed_route_source {
|
||||
allowed_route("http://example.com", {"source": "example.com"})
|
||||
allowed_route("http://example.com", {"source": "http://example.com"})
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue