File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -46,19 +46,32 @@ export async function onRequest(context) {
4646 ) ;
4747 const result = await response . json ( ) ;
4848 if ( result . error ) {
49- return new Response ( renderBody ( 'error' , result ) , { status : 401 } ) ;
49+ return new Response ( renderBody ( 'error' , result ) , {
50+ headers : {
51+ 'content-type' : 'text/html;charset=UTF-8' ,
52+ } ,
53+ status : 401
54+ } ) ;
5055 }
5156 const token = result . access_token ;
5257 const provider = 'github' ;
5358 const responseBody = renderBody ( 'success' , {
5459 token,
5560 provider,
5661 } ) ;
57- return new Response ( responseBody , { status : 200 } ) ;
62+ return new Response ( responseBody , {
63+ headers : {
64+ 'content-type' : 'text/html;charset=UTF-8' ,
65+ } ,
66+ status : 200
67+ } ) ;
5868
5969 } catch ( error ) {
6070 console . error ( error ) ;
6171 return new Response ( error . message , {
72+ headers : {
73+ 'content-type' : 'text/html;charset=UTF-8' ,
74+ } ,
6275 status : 500 ,
6376 } ) ;
6477 }
You can’t perform that action at this time.
0 commit comments