Content Negotiation logic possibly incorrect...? #9452
raphaklaus
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello! First of all, thanks for this amazing tool. You guys have been doing an incredible job!
According to this section of the documentation: https://kit.svelte.dev/docs/routing#server-content-negotiation
If the
Accept
header istext/html
execute a browser request, otherwise, the request is going to hit the respective function inside+server.ts
.It works perfectly until you have your site requested by a facebookbot/twitterbot/whateverbot that is going to send an arbitrary
Accept
value, such as*/*, image/webp
. Because it's not atext/html
it tries to call an HTTP verb-like middleware, but since it doesn't exist a405 Method not allowed
is returned. By default this behavior makes websites' SEO capabilities to do not work, requiring some configuring onsrc/hooks.server.ts
.To me, it's far-fetched to infer that an arbitrary (or even empty)
Accept
header should be interpreted as a server call.Beta Was this translation helpful? Give feedback.
All reactions