Spaces:
Running
Running
Update server.js
Browse files246 unmodified lines247248249246 unmodified linesapp.listen(PORT, "0.0.0.0", () => {console.log(`Listening on ${PORT}`);});246 unmodified lines247248249250251252253254255256257258259260261262263264265266267268269270271272273246 unmodified linesapp.listen(PORT, "0.0.0.0", () => {console.log(`Listening on ${PORT}`);});function protectedResourceMetadata(req) {const b = absBase(req);// ChatGPT が resource=.../sse を使うので /sse を resource として固定するのが安全const resource = `${b}/sse`;// authorization_servers は、あなたが discovery で返している issuer に合わせるconst as = oauthBase(req); // ここは既存の関数return {resource,authorization_servers: [as],scopes_supported: ["mcp", "offline_access", "openid", "email"],bearer_methods_supported: ["header"],};}function registerProtectedResource(path) {app.get(path, (req, res) => res.json(protectedResourceMetadata(req)));}registerProtectedResource("/.well-known/oauth-protected-resource");registerProtectedResource("/.well-known/oauth-protected-resource/*");registerProtectedResource("/sse/.well-known/oauth-protected-resource");registerProtectedResource("/sse/.well-known/oauth-protected-resource/*");
server.js+24