forked from misskey-dev/misskey
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: omit search for immutable static requests (misskey-dev#13265)
* perf: omit search for immutable static requests * perf: also applies to /files * fix: exclude /proxy * /files/:key/*を301 redirectに --------- Co-authored-by: tamaina <[email protected]> (cherry picked from commit 309a943) # Conflicts: # packages/backend/src/server/web/ClientServerService.ts
- Loading branch information
1 parent
ebc33f8
commit 2ec1d0e
Showing
3 changed files
with
224 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import type { onRequestHookHandler } from 'fastify'; | ||
|
||
export const handleRequestRedirectToOmitSearch: onRequestHookHandler = (request, reply, done) => { | ||
const index = request.url.indexOf('?'); | ||
if (~index) { | ||
reply.redirect(301, request.url.slice(0, index)); | ||
} | ||
done(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.