Skip to content

Commit c421486

Browse files
committed
Ensure redirects are mounted at the front of the queue, not the back
1 parent 08d899c commit c421486

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/bin/config/loader.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ export async function loadConfig(
212212
if (redirectMap.length > 0) {
213213
for (const server of config.servers) {
214214
for (const filePath of redirectMap) {
215-
server.mount.push({
215+
server.mount.unshift({
216216
type: 'redirect-map',
217217
mapping: filePath,
218218
status: 307,

src/bin/config/loader.test.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,13 +287,13 @@ describe('loadConfig', () => {
287287
{
288288
...DEFAULT_SERVER,
289289
mount: [
290-
DEFAULT_FILES,
291290
{
292291
type: 'redirect-map',
293292
mapping: './redirects.map',
294293
status: 307,
295294
options: { caseSensitive: false },
296295
},
296+
DEFAULT_FILES,
297297
],
298298
},
299299
],

0 commit comments

Comments
 (0)