fix(server): declare Allow: GET on the new 405 responses

RFC 9110 section 15.5.6 requires a 405 to name the methods it accepts, and
/api/radio/stations already does this in-tree. Thanks to kvnloo for catching it
on review. The same gap on the pre-existing handlers is tracked in #809 and is
deliberately left alone here.
This commit is contained in:
daikaginza committed 2026-09-29 10:56:20 +07:00
1 parent fb6b4e34f0
commit 2e5dfce1af
6 files changed
+15 -4

No files matched your search

+3
View File
@@ -398,6 +398,9 @@ test('the aircraft snapshot routes decline a non-GET before any upstream work',
for (const method of ['POST', 'PUT', 'DELETE', 'PATCH']) {
const response = await request(route, '/', method);
assert.equal(response.statusCode, 405, `${method} ${route}`);
// RFC 9110 section 15.5.6 requires a 405 to name the methods it does
// accept, which is what `/api/radio/stations` already does in-tree.
assert.equal(response.headers.allow, 'GET', `${method} ${route}`);
assert.deepEqual(JSON.parse(response.body), {
error: 'Method Not Allowed',
});
+2
View File
@@ -498,6 +498,8 @@ test('the routing proxy declines a non-GET before rate limiting or upstream', as
method,
);
assert.equal(response.statusCode, 405, method);
// RFC 9110 section 15.5.6 requires a 405 to name the methods it accepts.
assert.equal(response.headers.allow, 'GET', method);
assert.deepEqual(response.body, { error: 'Method Not Allowed' });
}
});