mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-21 04:35:09 +01:00
309a943528
* perf: omit search for immutable static requests * perf: also applies to /files * fix: exclude /proxy * /files/:key/*を301 redirectに --------- Co-authored-by: tamaina <tamaina@hotmail.co.jp>
9 lines
276 B
TypeScript
9 lines
276 B
TypeScript
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();
|
|
};
|