Merge pull request #1995 from ansuz/upload-checkup

add a checkup page test for /upload-blob
This commit is contained in:
yflory 2025-08-04 15:06:15 +02:00 committed by GitHub
commit 437bc15e96
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1649,6 +1649,27 @@ define([
});
});
// confirm that POST requests to the `/upload-blob` endpoint
// return something other than a 404, which would probably indicate
// a reverse proxy misconfiguration
assert(function (cb, msg) {
msg.appendChild(h('span', [
`The server returned a 404 error when attempting to reach the `,
h('code', `/upload-blob`),
` endpoint. This can be caused by an incorrectly configured reverse proxy.`,
]));
fetch('/upload-blob', {
method: 'POST',
}).then(res => {
console.log({ upload_fetch_response: res });
cb(res.status !== 404);
}).catch(err => {
console.error(err);
cb(false);
});
});
var row = function (cells) {
return h('tr', cells.map(function (cell) {
return h('td', cell);