Add doctype/lang and harden JSON response parsing
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
VERSION=1.1.0
|
||||
VERSION=1.1.1
|
||||
GIT_SHA=$(git rev-parse --short HEAD)
|
||||
IMAGE="docker.sdal.tech/beam:$VERSION-$GIT_SHA"
|
||||
IMAGE_LATEST="docker.sdal.tech/beam:latest"
|
||||
|
||||
+8
-3
@@ -1,4 +1,5 @@
|
||||
<html>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
@@ -247,8 +248,12 @@
|
||||
|
||||
xhr.addEventListener('load', () => {
|
||||
if (xhr.status === 200) {
|
||||
const response = JSON.parse(xhr.responseText);
|
||||
displayResults(response.urls);
|
||||
try {
|
||||
const response = JSON.parse(xhr.responseText);
|
||||
displayResults(response.urls);
|
||||
} catch (e) {
|
||||
showMessage('Upload failed: Unexpected response from server');
|
||||
}
|
||||
} else {
|
||||
let message = xhr.statusText;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user