(response: http.ServerResponse, origin: string)
| 105 | let sessionMethodRejection: { readonly method: string; readonly status: number } | undefined; |
| 106 | |
| 107 | const writeUnauthorized = (response: http.ServerResponse, origin: string) => |
| 108 | writeJson( |
| 109 | response, |
| 110 | 401, |
| 111 | { error: "invalid_token" }, |
| 112 | { |
| 113 | "www-authenticate": |
| 114 | options.auth?.wwwAuthenticate ?? |
| 115 | `Bearer resource_metadata="${origin}${protectedResourcePath}${path}", error="invalid_token"`, |
| 116 | }, |
| 117 | ); |
| 118 | |
| 119 | const namesJsonRpcMethod = (parsedBody: unknown, method: string): boolean => { |
| 120 | const messages = Array.isArray(parsedBody) ? parsedBody : [parsedBody]; |
no test coverage detected