mirror of
https://git.sr.ht/~cadence/cloudtube
synced 2024-11-10 02:27:29 +00:00
Strip trailing slash from instance
This commit is contained in:
parent
ebdc88fe4c
commit
c6363424cb
@ -31,7 +31,12 @@ module.exports = [
|
|||||||
for (const key of Object.keys(constants.user_settings)) {
|
for (const key of Object.keys(constants.user_settings)) {
|
||||||
const setting = constants.user_settings[key]
|
const setting = constants.user_settings[key]
|
||||||
if (params.has(key)) {
|
if (params.has(key)) {
|
||||||
const provided = params.get(key)
|
let provided = params.get(key)
|
||||||
|
|
||||||
|
if (key === "instance") {
|
||||||
|
provided = provided.replace(/\/+$/, "")
|
||||||
|
}
|
||||||
|
|
||||||
if (setting.type === "string") {
|
if (setting.type === "string") {
|
||||||
if (provided) data[key] = provided
|
if (provided) data[key] = provided
|
||||||
else data[key] = null
|
else data[key] = null
|
||||||
|
Loading…
Reference in New Issue
Block a user