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