You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// This is necessary to keep the compatibility with the previous version, otherwise the bodyParams will be an empty string when no content-type is sent
173
-
if(parsedBody===''){
174
-
return{};
167
+
returnObject.fromEntries(req.entries());
175
168
}
176
169
177
-
if(Array.isArray(parsedBody)){
178
-
returnparsedBody;
179
-
}
180
-
181
-
return{ ...parsedBody};
182
-
// eslint-disable-next-line no-empty
183
-
}catch{}
184
-
185
-
return{};
170
+
return{};
171
+
}catch{
172
+
// No problem if there is error, just means the endpoint is going to have to parse the body itself if necessary
173
+
return{};
174
+
}
186
175
}
187
176
188
177
protectedparseQueryParams(request: HonoRequest){
@@ -204,6 +193,7 @@ export class Router<
204
193
letqueryParams: Record<string,any>;
205
194
try{
206
195
queryParams=this.parseQueryParams(req);
196
+
c.set('queryParams',queryParams);
207
197
}catch(e){
208
198
logger.warn({msg: 'Error parsing query params for request',path: req.path,err: e});
0 commit comments