parent
1692675575
commit
f7b23d5cf1
2 changed files with 7 additions and 2 deletions
|
@ -110,7 +110,7 @@ export class AstroDevServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
const route = this.mostRecentRoute;
|
const route = this.mostRecentRoute;
|
||||||
const pathname = route?.pathname ?? '/';
|
const [pathname, search = undefined] = (route?.pathname ?? '/').split('?');
|
||||||
|
|
||||||
if (!route) {
|
if (!route) {
|
||||||
viteServer.ws.send({
|
viteServer.ws.send({
|
||||||
|
@ -274,7 +274,7 @@ export class AstroDevServer {
|
||||||
private async handleRequest(req: http.IncomingMessage, res: http.ServerResponse, next: NextFunction) {
|
private async handleRequest(req: http.IncomingMessage, res: http.ServerResponse, next: NextFunction) {
|
||||||
if (!this.viteServer) throw new Error(`AstroDevServer.start() not called`);
|
if (!this.viteServer) throw new Error(`AstroDevServer.start() not called`);
|
||||||
|
|
||||||
let pathname = req.url || '/'; // original request
|
let [pathname, search = undefined] = (req.url || '/').split('?'); // original request
|
||||||
const reqStart = performance.now();
|
const reqStart = performance.now();
|
||||||
let filePath: URL | undefined;
|
let filePath: URL | undefined;
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -23,6 +23,11 @@ describe('Development Routing', () => {
|
||||||
expect(response.status).to.equal(200);
|
expect(response.status).to.equal(200);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('200 when adding search params', async () => {
|
||||||
|
const response = await fixture.fetch('/?foo=bar');
|
||||||
|
expect(response.status).to.equal(200);
|
||||||
|
});
|
||||||
|
|
||||||
it('200 when loading non-root page', async () => {
|
it('200 when loading non-root page', async () => {
|
||||||
const response = await fixture.fetch('/another');
|
const response = await fixture.fetch('/another');
|
||||||
expect(response.status).to.equal(200);
|
expect(response.status).to.equal(200);
|
||||||
|
|
Loading…
Reference in a new issue