mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-06 07:48:38 +09:00
Remove Query/Ref from the directory listing URI.
Port of Bug 1488061.
This commit is contained in:
parent
b49317da4a
commit
a9b20e6dc7
1 changed files with 15 additions and 5 deletions
|
|
@ -146,7 +146,14 @@ nsIndexedToHTML::DoOnStartRequest(nsIRequest* request, nsISupports *aContext,
|
|||
nsAutoCString baseUri, titleUri;
|
||||
rv = uri->GetAsciiSpec(baseUri);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
titleUri = baseUri;
|
||||
|
||||
nsCOMPtr<nsIURI> titleURL;
|
||||
rv = uri->Clone(getter_AddRefs(titleURL));
|
||||
if (NS_FAILED(rv)) titleURL = uri;
|
||||
rv = titleURL->SetQuery(EmptyCString());
|
||||
if (NS_FAILED(rv)) titleURL = uri;
|
||||
rv = titleURL->SetRef(EmptyCString());
|
||||
if (NS_FAILED(rv)) titleURL = uri;
|
||||
|
||||
nsCString parentStr;
|
||||
|
||||
|
|
@ -170,16 +177,14 @@ nsIndexedToHTML::DoOnStartRequest(nsIRequest* request, nsISupports *aContext,
|
|||
// that - see above
|
||||
|
||||
nsAutoCString pw;
|
||||
rv = uri->GetPassword(pw);
|
||||
rv = titleURL->GetPassword(pw);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
if (!pw.IsEmpty()) {
|
||||
nsCOMPtr<nsIURI> newUri;
|
||||
rv = uri->Clone(getter_AddRefs(newUri));
|
||||
rv = titleURL->Clone(getter_AddRefs(newUri));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = newUri->SetPassword(EmptyCString());
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = newUri->GetAsciiSpec(titleUri);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
}
|
||||
|
||||
nsAutoCString path;
|
||||
|
|
@ -247,6 +252,11 @@ nsIndexedToHTML::DoOnStartRequest(nsIRequest* request, nsISupports *aContext,
|
|||
}
|
||||
}
|
||||
|
||||
rv = titleURL->GetAsciiSpec(titleUri);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
buffer.AppendLiteral("<style type=\"text/css\">\n"
|
||||
":root {\n"
|
||||
" font-family: sans-serif;\n"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue