mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-12-16 22:39:00 +01:00
29f6ba6310
* chore: add workflow which checks if SPDX ID exists * chore: add missing SPDX ID in some files * chore: change trigger condition * chore: trigger on push * lint
14 lines
380 B
TypeScript
14 lines
380 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
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();
|
|
};
|