Skip to content

Commit 015c9bb

Browse files
author
DimitarTachev
committed
fix: fix the shortener endpoint usage
1 parent e4d984b commit 015c9bb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/services/livesync/playground/qr-code-generator.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ export class PlaygroundQrCodeGenerator implements IPlaygroundQrCodeGenerator {
2828
}
2929

3030
private async generateQrCodeCore(url: string): Promise<void> {
31-
const shortenUrlEndpoint = util.format(this.$config.SHORTEN_URL_ENDPOINT, url);
31+
const shortenUrlEndpoint = util.format(this.$config.SHORTEN_URL_ENDPOINT, encodeURIComponent(url));
3232
try {
3333
const response = await this.$httpClient.httpRequest(shortenUrlEndpoint);
3434
const responseBody = JSON.parse(response.body);
35-
url = responseBody.shortURL || url;
35+
url = responseBody.shortUrl || url;
3636
} catch (e) {
3737
// use the longUrl
3838
}

0 commit comments

Comments
 (0)