docs(server): tighten the method-guard comments and changelog

This commit is contained in:
German Khokhlov committed 2026-11-09 19:07:14 +04:00
1 parent ace88172d3
commit c3738c0fdb
7 files changed
+13 -30

No files matched your search

+1 -3
View File
@@ -83,9 +83,7 @@ export function adsbLolProxy() {
// This mount also matches its /track route, served by its own handler.
if (new URL(req.url || '/', 'http://localhost').pathname !== '/')
return next();
// Read-only snapshot endpoint; match the method contract its sibling
// query proxies already declare instead of serving every verb alike.
// Checked after the /track hand-off, so that route keeps its own.
// After the /track hand-off, so /track keeps its own method handling.
if (req.method !== 'GET') {
res.writeHead(405, {
'Content-Type': 'application/json',
+1 -4
View File
@@ -496,10 +496,7 @@ export function openSkyProxy() {
// This mount also matches its /track route, served by its own handler.
if (new URL(req.url || '/', 'http://localhost').pathname !== '/')
return next();
// Read-only snapshot endpoint: state the method contract the way
// /api/geocode and the other query proxies state it, rather than
// answering any verb with the same body and ignoring the request body.
// Checked after the /track hand-off, so that route keeps its own.
// After the /track hand-off, so /track keeps its own method handling.
if (req.method !== 'GET') {
res.writeHead(405, {
'Content-Type': 'application/json',
-2
View File
@@ -227,8 +227,6 @@ export function installRouteMiddleware(
// only shape that asks the upstream for them. A response WITHOUT steps is
// byte for byte what this endpoint has always returned.
middlewares.use('/api/route', async (req, res) => {
// The documented shape above is a GET with query parameters; say so,
// the way the other query proxies do, instead of answering any verb.
if (req.method !== 'GET') {
res.writeHead(405, { 'Content-Type': 'application/json', Allow: 'GET' });
res.end(JSON.stringify({ error: 'Method Not Allowed' }));