mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-21 08:55:08 +01:00
10 lines
276 B
TypeScript
10 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();
|
||
|
};
|