Skip to content

Commit

Permalink
feature: 支持在serverLoader中读取当前request,以实现在serverLoader中读取url中的参数和headers
Browse files Browse the repository at this point in the history
  • Loading branch information
奇风 committed Oct 18, 2023
1 parent 26e3276 commit 7530f81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/server/src/ssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ function createJSXGenerator(opts: CreateRequestHandlerOptions) {
sourceDir,
} = opts;

const { pathname } = new URL(url);
// make import { history } from 'umi' work
createHistory({ type: 'memory', initialEntries: [url], initialIndex: 1 });

Expand All @@ -79,6 +78,7 @@ function createJSXGenerator(opts: CreateRequestHandlerOptions) {
},
});

const { pathname } = new URL(url);
const matches = matchRoutesForSSR(pathname, routes);
if (matches.length === 0) {
return;
Expand Down

0 comments on commit 7530f81

Please sign in to comment.