You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ask Claude to implement CORS as needed by public clients.
prompt: To fully support "public" clients, we need to support CORS on all the endpoints implemented by OAuthProvider. For convenience, we should also automatically enable CORS on API endpoints implemented by the app. (We should not, however, enable CORS on anything handled by the default handler.)
Claude wasn't aware of the best way to mutate Response headers.
prompt: The way you construct the final `Response` here could be lossy if the platform supports properties other than `status`, `statusText`, and `headers`. The better way to modify response headers it to first use `response = new Response(response.body, response)` to make the response mutable, then use `response.headers.set(name, value)` to modify the response headers directly.
Initially Claude allowed credentials but only the GET, POST, and OPTIONS methods, and only the `Content-Type` and `Authorization` headers.
prompt: Two things: (1) Let's not allow credentials. APIs should be authenticated strictly based on the access token, not the user's cookies. (2) Let's set access-control-allow-methods to `*` to allow all methods.
prompt: Let's also allow all headers.
prompt: Oops, the `Authorization` header needs to be listed explicitly, it is special and not included in `*`. But we need to allow it for passing access tokens.
0 commit comments