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