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