mirror of https://github.com/alibaba/ice.git
fix: query info in fc (#6572)
* fix: compatible with query parsing errors caused by ctx.req.url error in the fc environment * chore: add changelog
This commit is contained in:
parent
aa29b37b59
commit
df854102c9
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@ice/runtime': patch
|
||||
---
|
||||
|
||||
fix: compatible with query parsing errors caused by ctx.req.url error in the fc environment
|
||||
|
|
@ -10,7 +10,9 @@ export interface Location {
|
|||
*/
|
||||
export default function getRequestContext(location: Location, serverContext: ServerContext = {}): RequestContext {
|
||||
const { pathname, search } = location;
|
||||
const query = parseSearch(search);
|
||||
// Use query form server context first to avoid unnecessary parsing.
|
||||
// @ts-ignore
|
||||
const query = serverContext?.req?.query || parseSearch(search);
|
||||
|
||||
const requestContext: RequestContext = {
|
||||
...(serverContext || {}),
|
||||
|
|
|
|||
Loading…
Reference in New Issue