-
-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
These seems to be an issue, where if I send headers using Fastify, then anything that gets added by Remix is overriden, e.g.
Here I am adding link header:
await app.register(async (instance) => {
instance.decorateRequest('cspNonce', null);
instance.removeAllContentTypeParsers();
instance.addContentTypeParser('*', (_request, payload, done) => {
done(null, payload);
});
const handler = createRequestHandler({
build: serverBuild,
getLoadContext(request) {
return {
nonce: request.cspNonce,
session: request.session as unknown as Session,
visitor: request.visitor,
};
},
mode: 'production',
});
instance.all('*', async (request, reply) => {
const links = getLinks(request.url);
reply.header(
'Link',
[
'</fonts/gabarito/Gabarito-VariableFont.woff2>; rel=preload; as=font; crossorigin',
...links,
].join(', '),
);
try {
return handler(request, reply);
} catch (error) {
captureException({
error,
extra: {
url: request.url,
},
message: 'could not render request',
});
return replyWithErrorPage(reply, error);
}
});
});but the loaded route also send link header, which overrides my value from the above.
I would expect headers such as link to be merged.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels