Skip to content

Commit

Permalink
use 1x1 GIF for placeholder image
Browse files Browse the repository at this point in the history
  • Loading branch information
thestinger committed Dec 5, 2021
1 parent fc4a549 commit 687017f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,14 @@ http {
add_header Cache-Control "public, max-age=604800";
}

location ~ "\.gif$" {
include snippets/security-headers.conf;
add_header Cross-Origin-Resource-Policy "same-origin" always;
add_header Cache-Control "public, max-age=31536000, immutable";
gzip_static off;
brotli_static off;
}

location ~ "\.png$" {
include snippets/security-headers.conf;
# avoid breaking image hotlinking such as https://github.com/TryGhost/Ghost/issues/12880
Expand Down
2 changes: 1 addition & 1 deletion static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ <h1 id="device-integrity-monitoring">
<p>Subscribe a device to regularly submitting attestations to this account by pressing 'Enable remote verification' in the Auditor app menu and scanning the QR code for this account:</p>
<section id="pairing">
<h2><a href="#pairing">Pair devices</a></h2>
<img id="qr" height="300" width="300" alt="" src="/placeholder.png"/>
<img id="qr" height="300" width="300" alt="" src="/placeholder.gif"/>
<button id="rotate">Rotate device subscription key</button>
</section>
<form id="configuration">
Expand Down
4 changes: 2 additions & 2 deletions static/monitoring.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function toSecurityLevelString(value) {
}

function reloadQrCode() {
qr.src = "/placeholder.png";
qr.src = "/placeholder.gif";
qr.alt = "";
post("/api/account.png", localStorage.getItem("requestToken")).then(response => {
if (!response.ok) {
Expand Down Expand Up @@ -456,7 +456,7 @@ for (const logoutButton of document.getElementsByClassName("logout")) {
accountContent.hidden = true;
username.innerText = null;
configuration.reset();
qr.src = "/placeholder.png";
qr.src = "/placeholder.gif";
qr.alt = "";
loggedInButtons.hidden = true;
logout.disabled = false;
Expand Down
Binary file added static/placeholder.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed static/placeholder.png
Binary file not shown.

0 comments on commit 687017f

Please sign in to comment.