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 @@ -11,7 +11,9 @@ export const parseAuthHeaders = (req: IncomingMessage): Partial<ClientOptions> =
1111 case 'Bearer' :
1212 return { apiKey : req . headers . authorization . slice ( 'Bearer ' . length ) } ;
1313 default :
14- throw new Error ( `Unsupported authorization scheme` ) ;
14+ throw new Error (
15+ 'Unsupported authorization scheme. Expected the "Authorization" header to be a supported scheme (Bearer).' ,
16+ ) ;
1517 }
1618 }
1719
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