File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,9 @@ export const parseAuthHeaders = (req: IncomingMessage): Partial<ClientOptions> =
1717 clientSecret : rawValue . slice ( rawValue . search ( ':' ) + 1 ) ,
1818 } ;
1919 default :
20- throw new Error ( `Unsupported authorization scheme` ) ;
20+ throw new Error (
21+ 'Unsupported authorization scheme. Expected the "Authorization" header to be a supported scheme (Bearer, Basic).' ,
22+ ) ;
2123 }
2224 }
2325
Original file line number Diff line number Diff line change @@ -46,12 +46,12 @@ const newServer = ({
4646 } ,
4747 mcpOptions,
4848 } ) ;
49- } catch {
49+ } catch ( error ) {
5050 res . status ( 401 ) . json ( {
5151 jsonrpc : '2.0' ,
5252 error : {
5353 code : - 32000 ,
54- message : ' Unauthorized' ,
54+ message : ` Unauthorized: ${ error instanceof Error ? error . message : error } ` ,
5555 } ,
5656 } ) ;
5757 return null ;
You can’t perform that action at this time.
0 commit comments