@@ -86,10 +86,21 @@ export async function getGuildRolesHandler(request: IRequest, env: env) {
86
86
{ error : response . ROLE_FETCH_FAILED } ,
87
87
{
88
88
status : 500 ,
89
+ headers : {
90
+ "content-type" : "application/json;charset=UTF-8" ,
91
+ } ,
89
92
}
90
93
) ;
91
94
}
92
- return new JSONResponse ( response . INTERNAL_SERVER_ERROR , { status : 500 } ) ;
95
+ return new JSONResponse (
96
+ { error : response . INTERNAL_SERVER_ERROR } ,
97
+ {
98
+ status : 500 ,
99
+ headers : {
100
+ "content-type" : "application/json;charset=UTF-8" ,
101
+ } ,
102
+ }
103
+ ) ;
93
104
}
94
105
}
95
106
@@ -111,7 +122,12 @@ export async function getGuildRoleByRoleNameHandler(
111
122
await verifyAuthToken ( authHeader , env ) ;
112
123
const role = await getGuildRoleByName ( roleName , env ) ;
113
124
if ( ! role ) {
114
- return new JSONResponse ( response . NOT_FOUND , { status : 404 } ) ;
125
+ return new JSONResponse ( response . NOT_FOUND , {
126
+ status : 404 ,
127
+ headers : {
128
+ "content-type" : "application/json;charset=UTF-8" ,
129
+ } ,
130
+ } ) ;
115
131
}
116
132
return new JSONResponse ( role ) ;
117
133
} catch ( err : any ) {
@@ -120,9 +136,20 @@ export async function getGuildRoleByRoleNameHandler(
120
136
{ error : response . ROLE_FETCH_FAILED } ,
121
137
{
122
138
status : 500 ,
139
+ headers : {
140
+ "content-type" : "application/json;charset=UTF-8" ,
141
+ } ,
123
142
}
124
143
) ;
125
144
}
126
- return new JSONResponse ( response . INTERNAL_SERVER_ERROR , { status : 500 } ) ;
145
+ return new JSONResponse (
146
+ { error : response . INTERNAL_SERVER_ERROR } ,
147
+ {
148
+ status : 500 ,
149
+ headers : {
150
+ "content-type" : "application/json;charset=UTF-8" ,
151
+ } ,
152
+ }
153
+ ) ;
127
154
}
128
155
}
0 commit comments