File tree Expand file tree Collapse file tree 17 files changed +17
-34
lines changed
02.init/02.solution.params/src
01.problem.introspect/src
01.solution.introspect/src
01.problem.check-scopes/src
01.solution.check-scopes/src
02.problem.validate-sufficient-scope/src
02.solution.validate-sufficient-scope/src
03.problem.scope-hints/src
03.solution.scope-hints/src Expand file tree Collapse file tree 17 files changed +17
-34
lines changed Original file line number Diff line number Diff line change 11import { EPIC_ME_AUTH_SERVER_URL } from './client.ts'
22
33export function handleUnauthorized ( request : Request ) {
4- const url = new URL ( request . url )
5- url . pathname = '/.well-known/oauth-protected-resource/mcp'
4+ const url = new URL ( '/.well-known/oauth-protected-resource/mcp' , request . url )
65
76 return new Response ( 'Unauthorized' , {
87 status : 401 ,
Original file line number Diff line number Diff line change @@ -25,8 +25,7 @@ import { EPIC_ME_AUTH_SERVER_URL } from './client.ts'
2525// 🐨 return the AuthInfo (💰 the sub is the userId)
2626
2727export function handleUnauthorized ( request : Request ) {
28- const url = new URL ( request . url )
29- url . pathname = '/.well-known/oauth-protected-resource/mcp'
28+ const url = new URL ( '/.well-known/oauth-protected-resource/mcp' , request . url )
3029
3130 return new Response ( 'Unauthorized' , {
3231 status : 401 ,
Original file line number Diff line number Diff line change @@ -42,8 +42,7 @@ export async function resolveAuthInfo(
4242}
4343
4444export function handleUnauthorized ( request : Request ) {
45- const url = new URL ( request . url )
46- url . pathname = '/.well-known/oauth-protected-resource/mcp'
45+ const url = new URL ( '/.well-known/oauth-protected-resource/mcp' , request . url )
4746
4847 return new Response ( 'Unauthorized' , {
4948 status : 401 ,
Original file line number Diff line number Diff line change @@ -44,8 +44,7 @@ export async function resolveAuthInfo(
4444export function handleUnauthorized ( request : Request ) {
4545 // 🐨 make a "hasAuthHeader" variable that's true if the request has an Authorization header
4646
47- const url = new URL ( request . url )
48- url . pathname = '/.well-known/oauth-protected-resource/mcp'
47+ const url = new URL ( '/.well-known/oauth-protected-resource/mcp' , request . url )
4948
5049 return new Response ( 'Unauthorized' , {
5150 status : 401 ,
Original file line number Diff line number Diff line change @@ -44,8 +44,7 @@ export async function resolveAuthInfo(
4444export function handleUnauthorized ( request : Request ) {
4545 const hasAuthHeader = request . headers . has ( 'authorization' )
4646
47- const url = new URL ( request . url )
48- url . pathname = '/.well-known/oauth-protected-resource/mcp'
47+ const url = new URL ( '/.well-known/oauth-protected-resource/mcp' , request . url )
4948
5049 return new Response ( 'Unauthorized' , {
5150 status : 401 ,
Original file line number Diff line number Diff line change @@ -48,8 +48,7 @@ export async function resolveAuthInfo(
4848export function handleUnauthorized ( request : Request ) {
4949 const hasAuthHeader = request . headers . has ( 'authorization' )
5050
51- const url = new URL ( request . url )
52- url . pathname = '/.well-known/oauth-protected-resource/mcp'
51+ const url = new URL ( '/.well-known/oauth-protected-resource/mcp' , request . url )
5352 return new Response ( 'Unauthorized' , {
5453 status : 401 ,
5554 headers : {
Original file line number Diff line number Diff line change @@ -52,8 +52,7 @@ export async function resolveAuthInfo(
5252export function handleUnauthorized ( request : Request ) {
5353 const hasAuthHeader = request . headers . has ( 'authorization' )
5454
55- const url = new URL ( request . url )
56- url . pathname = '/.well-known/oauth-protected-resource/mcp'
55+ const url = new URL ( '/.well-known/oauth-protected-resource/mcp' , request . url )
5756 return new Response ( 'Unauthorized' , {
5857 status : 401 ,
5958 headers : {
Original file line number Diff line number Diff line change @@ -52,8 +52,7 @@ export async function resolveAuthInfo(
5252export function handleUnauthorized ( request : Request ) {
5353 const hasAuthHeader = request . headers . has ( 'authorization' )
5454
55- const url = new URL ( request . url )
56- url . pathname = '/.well-known/oauth-protected-resource/mcp'
55+ const url = new URL ( '/.well-known/oauth-protected-resource/mcp' , request . url )
5756 return new Response ( 'Unauthorized' , {
5857 status : 401 ,
5958 headers : {
Original file line number Diff line number Diff line change @@ -52,8 +52,7 @@ export async function resolveAuthInfo(
5252export function handleUnauthorized ( request : Request ) {
5353 const hasAuthHeader = request . headers . has ( 'authorization' )
5454
55- const url = new URL ( request . url )
56- url . pathname = '/.well-known/oauth-protected-resource/mcp'
55+ const url = new URL ( '/.well-known/oauth-protected-resource/mcp' , request . url )
5756 return new Response ( 'Unauthorized' , {
5857 status : 401 ,
5958 headers : {
Original file line number Diff line number Diff line change @@ -52,8 +52,7 @@ export async function resolveAuthInfo(
5252export function handleUnauthorized ( request : Request ) {
5353 const hasAuthHeader = request . headers . has ( 'authorization' )
5454
55- const url = new URL ( request . url )
56- url . pathname = '/.well-known/oauth-protected-resource/mcp'
55+ const url = new URL ( '/.well-known/oauth-protected-resource/mcp' , request . url )
5756 return new Response ( 'Unauthorized' , {
5857 status : 401 ,
5958 headers : {
You can’t perform that action at this time.
0 commit comments