mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2024-11-10 01:01:55 +01:00
Added better server address trimming.
This commit is contained in:
parent
2b558c43bd
commit
50f293d783
1 changed files with 4 additions and 4 deletions
|
@ -357,10 +357,10 @@ function activatePrivateTextChange(element: HTMLElement) {
|
|||
* @param input Input server address
|
||||
*/
|
||||
function validateServerAddress(input: string): string {
|
||||
// Trim the last slash if needed
|
||||
if (input.endsWith("/")) {
|
||||
input = input.substring(0, input.length - 1);
|
||||
}
|
||||
input = input.trim();
|
||||
|
||||
// Trim the trailing slashes
|
||||
input = input.replace(/\/+$/, "");
|
||||
|
||||
// If it isn't HTTP protocol
|
||||
if ((!input.startsWith("https://") && !input.startsWith("http://"))) {
|
||||
|
|
Loading…
Reference in a new issue