Merge pull request #11 from bakkot/protocol-has-colon

fix port parsing logic
This commit is contained in:
Simon 2022-12-02 14:18:35 +07:00 committed by GitHub
commit 52b65bf48b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,7 +29,7 @@ document.getElementById("save-login").addEventListener("click", function () {
let toStore = { let toStore = {
"access": { "access": {
"url": `${parsed.protocol}//${parsed.hostname}`, "url": `${parsed.protocol}//${parsed.hostname}`,
"port": parsed.port || (parsed.protocol === 'https' ? '443' : '80'), "port": parsed.port || (parsed.protocol === 'https:' ? '443' : '80'),
"apiKey": document.getElementById("api-key").value "apiKey": document.getElementById("api-key").value
} }
}; };