When controlUiBasePath is set, classifyControlUiRequest returned method-not-allowed (405) for all non-GET/HEAD requests under basePath, blocking plugin webhook handlers (BlueBubbles, Mattermost, etc.) from receiving POST requests. This is a 2026.3.1 regression. Return not-control-ui instead, matching the empty-basePath behavior, so requests fall through to plugin HTTP handlers. Remove the now-dead method-not-allowed type variant, handler branch, and utility function. Closes #31983 Closes #32275 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
16 lines
488 B
TypeScript
16 lines
488 B
TypeScript
import type { ServerResponse } from "node:http";
|
|
|
|
export function isReadHttpMethod(method: string | undefined): boolean {
|
|
return method === "GET" || method === "HEAD";
|
|
}
|
|
|
|
export function respondPlainText(res: ServerResponse, statusCode: number, body: string): void {
|
|
res.statusCode = statusCode;
|
|
res.setHeader("Content-Type", "text/plain; charset=utf-8");
|
|
res.end(body);
|
|
}
|
|
|
|
export function respondNotFound(res: ServerResponse): void {
|
|
respondPlainText(res, 404, "Not Found");
|
|
}
|