File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -40,13 +40,17 @@ export const handler: Handlers<unknown, State> = {
40
40
shieldsUrl . searchParams . set ( "logo" , "jsr" ) ;
41
41
shieldsUrl . searchParams . set ( "logoColor" , "rgb(8,51,68)" ) ;
42
42
shieldsUrl . searchParams . set ( "logoSize" , "auto" ) ;
43
+ shieldsUrl . searchParams . set ( "cacheSeconds" , "300" ) ;
43
44
44
45
const res = await fetch ( shieldsUrl ) ;
45
46
46
47
return new Response ( res . body , {
47
48
status : res . status ,
48
49
headers : {
49
- "cache-control" : "max-age=300, s-maxage=300" ,
50
+ "access-control-allow-origin" : res . headers . get (
51
+ "access-control-allow-origin" ,
52
+ ) ! ,
53
+ "cache-control" : res . headers . get ( "cache-control" ) ! ,
50
54
"content-type" : res . headers . get ( "content-type" ) ! ,
51
55
} ,
52
56
} ) ;
Original file line number Diff line number Diff line change @@ -44,13 +44,17 @@ export const handler: Handlers<unknown, State> = {
44
44
shieldsUrl . searchParams . set ( "logo" , "jsr" ) ;
45
45
shieldsUrl . searchParams . set ( "logoColor" , "rgb(8,51,68)" ) ;
46
46
shieldsUrl . searchParams . set ( "logoSize" , "auto" ) ;
47
+ shieldsUrl . searchParams . set ( "cacheSeconds" , "300" ) ;
47
48
48
49
const res = await fetch ( shieldsUrl ) ;
49
50
50
51
return new Response ( res . body , {
51
52
status : res . status ,
52
53
headers : {
53
- "cache-control" : "max-age=300, s-maxage=300" ,
54
+ "access-control-allow-origin" : res . headers . get (
55
+ "access-control-allow-origin" ,
56
+ ) ! ,
57
+ "cache-control" : res . headers . get ( "cache-control" ) ! ,
54
58
"content-type" : res . headers . get ( "content-type" ) ! ,
55
59
} ,
56
60
} ) ;
Original file line number Diff line number Diff line change @@ -40,13 +40,17 @@ export const handler: Handlers<unknown, State> = {
40
40
shieldsUrl . searchParams . set ( "logo" , "jsr" ) ;
41
41
shieldsUrl . searchParams . set ( "logoColor" , "rgb(8,51,68)" ) ;
42
42
shieldsUrl . searchParams . set ( "logoSize" , "auto" ) ;
43
+ shieldsUrl . searchParams . set ( "cacheSeconds" , "300" ) ;
43
44
44
45
const res = await fetch ( shieldsUrl ) ;
45
46
46
47
return new Response ( res . body , {
47
48
status : res . status ,
48
49
headers : {
49
- "cache-control" : "max-age=300, s-maxage=300" ,
50
+ "access-control-allow-origin" : res . headers . get (
51
+ "access-control-allow-origin" ,
52
+ ) ! ,
53
+ "cache-control" : res . headers . get ( "cache-control" ) ! ,
50
54
"content-type" : res . headers . get ( "content-type" ) ! ,
51
55
} ,
52
56
} ) ;
You can’t perform that action at this time.
0 commit comments