-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Append trailing slash to URL if missing #14822
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,14 @@ | |
<html lang="${LANG}"> | ||
|
||
<head> | ||
<script> | ||
let path = window.location.pathname; | ||
if (path) { | ||
let lastChar = path.substr(path.length - 1); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
if (lastChar != '/') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if (lastChar !== '/') |
||
window.location.replace(window.location.href + '/'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would this redirection break other things? such as the magnet handler? |
||
} | ||
</script> | ||
<meta charset="UTF-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=10" /> | ||
<title>qBittorrent Web UI</title> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,14 @@ | |
<html lang="${LANG}"> | ||
|
||
<head> | ||
<script> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please move it to the next line of |
||
let path = window.location.pathname; | ||
if (path) { | ||
let lastChar = path.substr(path.length - 1); | ||
if (lastChar != '/') | ||
window.location.replace(window.location.href + '/'); | ||
} | ||
</script> | ||
<meta charset="UTF-8" /> | ||
<title>qBittorrent QBT_TR(Web UI)QBT_TR[CONTEXT=OptionsDialog]</title> | ||
<link rel="icon" type="image/png" href="images/qbittorrent32.png" /> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use
const
:const path = ...