Bugfix: Medium URL question mark wasn't being added properly

It was adding the question-mark only if ? was found at position 0
(i.e. at the beginning) instead of at position -1 (i.e. not present
at all).
This commit is contained in:
Badri Sunderarajan 2021-01-09 16:53:33 +05:30
parent 302a74d679
commit a35d6195cf
1 changed files with 1 additions and 1 deletions

View File

@ -340,7 +340,7 @@ class Seance {
// intelligently add ?json attribute
if (mediumUrl.indexOf('format=json') == -1) {
if (mediumUrl.indexOf('?') == 0) {
if (mediumUrl.indexOf('?') == -1) {
mediumUrl = `${mediumUrl}?format=json`
} else {
mediumUrl = `${mediumUrl}&format=json`