fix(ap): correct webfinger patch snippet to match current fork (318720c)
The OLD_SNIPPET had wrong indentation (8 spaces vs 6) and was missing the method guard line added in the fork: if (req.method !== "GET" && req.method !== "HEAD") return next(); Without this fix the patch silently skips patching and webfinger continues to return 302 → 401 on fediverse delivery. https://claude.ai/code/session_0124D41vdLYE3DkJxhPqYthX
This commit is contained in:
@@ -30,14 +30,18 @@ const candidates = [
|
|||||||
|
|
||||||
const MARKER = "// ap-webfinger-before-auth patch";
|
const MARKER = "// ap-webfinger-before-auth patch";
|
||||||
|
|
||||||
const OLD_SNIPPET = ` // Only delegate to Fedify for NodeInfo data endpoint (/nodeinfo/2.1).
|
const OLD_SNIPPET = ` if (!self._fedifyMiddleware) return next();
|
||||||
|
if (req.method !== "GET" && req.method !== "HEAD") return next();
|
||||||
|
// Only delegate to Fedify for NodeInfo data endpoint (/nodeinfo/2.1).
|
||||||
// All other paths in this root-mounted router are handled by the
|
// All other paths in this root-mounted router are handled by the
|
||||||
// content negotiation catch-all below. Passing arbitrary paths like
|
// content negotiation catch-all below. Passing arbitrary paths like
|
||||||
// /notes/... to Fedify causes harmless but noisy 404 warnings.
|
// /notes/... to Fedify causes harmless but noisy 404 warnings.
|
||||||
if (!req.path.startsWith("/nodeinfo/")) return next();
|
if (!req.path.startsWith("/nodeinfo/")) return next();
|
||||||
return self._fedifyMiddleware(req, res, next);`;
|
return self._fedifyMiddleware(req, res, next);`;
|
||||||
|
|
||||||
const NEW_SNIPPET = ` // Delegate to Fedify for discovery endpoints:
|
const NEW_SNIPPET = ` if (!self._fedifyMiddleware) return next();
|
||||||
|
if (req.method !== "GET" && req.method !== "HEAD") return next();
|
||||||
|
// Delegate to Fedify for discovery endpoints:
|
||||||
// /.well-known/webfinger — actor/resource identity resolution
|
// /.well-known/webfinger — actor/resource identity resolution
|
||||||
// /.well-known/nodeinfo — server capabilities advertised to the fediverse
|
// /.well-known/nodeinfo — server capabilities advertised to the fediverse
|
||||||
// /nodeinfo/2.1 — NodeInfo data document
|
// /nodeinfo/2.1 — NodeInfo data document
|
||||||
|
|||||||
Reference in New Issue
Block a user