mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 09:31:22 -05:00
Default base URL path to '/' (#2921)
This commit is contained in:
parent
f38bd45bf9
commit
ad11f2ad6a
2 changed files with 5 additions and 1 deletions
|
@ -333,7 +333,7 @@ export class URL {
|
|||
password: baseParts.password,
|
||||
hostname: baseParts.hostname,
|
||||
port: baseParts.port,
|
||||
path: resolvePathFromBase(urlParts.path, baseParts.path),
|
||||
path: resolvePathFromBase(urlParts.path, baseParts.path || "/"),
|
||||
query: urlParts.query,
|
||||
hash: urlParts.hash
|
||||
};
|
||||
|
|
|
@ -152,6 +152,10 @@ test(function urlRelativeWithBase(): void {
|
|||
assertEquals(new URL("../b", "file:///a/a/a").href, "file:///a/b");
|
||||
});
|
||||
|
||||
test(function emptyBasePath(): void {
|
||||
assertEquals(new URL("", "http://example.com").href, "http://example.com/");
|
||||
});
|
||||
|
||||
test(function deletingAllParamsRemovesQuestionMarkFromURL(): void {
|
||||
const url = new URL("http://example.com/?param1¶m2");
|
||||
url.searchParams.delete("param1");
|
||||
|
|
Loading…
Add table
Reference in a new issue