mirror of
https://github.com/samsonjs/agate.git
synced 2026-03-25 09:05:50 +00:00
add tests for fragment and userinfo URLs
This commit is contained in:
parent
ba9297eabf
commit
869a784b59
1 changed files with 39 additions and 0 deletions
|
|
@ -244,6 +244,45 @@ fn full_header_preset() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
/// - URLS with fragments are rejected
|
||||
fn fragment() {
|
||||
let page = get(
|
||||
&["--addr", "[::]:1983", "--hostname", "example.com"],
|
||||
addr(1983),
|
||||
"gemini://example.com/#fragment",
|
||||
)
|
||||
.expect("could not get page");
|
||||
|
||||
assert_eq!(page.header.status, Status::BadRequest);
|
||||
}
|
||||
|
||||
#[test]
|
||||
/// - URLS with username are rejected
|
||||
fn username() {
|
||||
let page = get(
|
||||
&["--addr", "[::]:1984", "--hostname", "example.com"],
|
||||
addr(1984),
|
||||
"gemini://user@example.com/",
|
||||
)
|
||||
.expect("could not get page");
|
||||
|
||||
assert_eq!(page.header.status, Status::BadRequest);
|
||||
}
|
||||
|
||||
#[test]
|
||||
/// - URLS with password are rejected
|
||||
fn password() {
|
||||
let page = get(
|
||||
&["--addr", "[::]:1984", "--hostname", "example.com"],
|
||||
addr(1984),
|
||||
"gemini://:secret@example.com/",
|
||||
)
|
||||
.expect("could not get page");
|
||||
|
||||
assert_eq!(page.header.status, Status::BadRequest);
|
||||
}
|
||||
|
||||
#[test]
|
||||
/// - hostname is checked when provided
|
||||
/// - status for wrong host is "proxy request refused"
|
||||
|
|
|
|||
Loading…
Reference in a new issue