lambda-packages icon indicating copy to clipboard operation
lambda-packages copied to clipboard

🐛 BUG: RSS stylesheet doesn't work according to docs

Open garfieldnate opened this issue 3 years ago • 2 comments

What version of astro are you using?

1.0.0-beta.73

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

yarn

What operating system are you using?

Mac

Describe the Bug

Following the documentation for adding RSS to my site, I tried to add the pretty-feeds-v3.xsl stylesheet to the site so that users going to the rss.xml URL would see something introducing them to what RSS is.

However, the styling never seems to work. I get the same browser output with or without the stylesheet specified. I checked the returned headers with wget:

 wget localhost:3000/rss.xml
--2022-07-21 21:54:25--  http://localhost:3000/rss.xml
Resolving localhost (localhost)... 127.0.0.1, ::1
Connecting to localhost (localhost)|127.0.0.1|:3000... connected.
HTTP request sent, awaiting response...
  HTTP/1.1 200 OK
  Access-Control-Allow-Origin: *
  Content-Type: application/xml;charset=utf-8
  Date: Thu, 21 Jul 2022 19:54:25 GMT
  Connection: keep-alive
  Keep-Alive: timeout=5
  Transfer-Encoding: chunked
Length: unspecified [application/xml]
Saving to: ‘rss.xml’ 

I'm not sure if it's the cause of the issue, but there is one header missing. The documentation for pretty-feeds-v3 says that in order to use the stylesheet you have to set the header x-content-type-options: nosniff, but Astro doesn't seem to be doing that.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-nepsa5?file=src/pages/rss.xml.js

Participation

  • [ ] I am willing to submit a pull request for this issue.

garfieldnate avatar Jul 21 '22 20:07 garfieldnate

Sorry, I think this doesn't work on stackblitz but it works fine locally.

garfieldnate avatar Jul 21 '22 20:07 garfieldnate

Thanks for the issue @garfieldnate! If the output is a static .xml file, we don't have a way to set your headers. This has to be done however your specific host supports it.

If I misunderstood and this is an issue with our server output using an adapter, please let me know.

natemoo-re avatar Jul 25 '22 16:07 natemoo-re

This issue is quite state and we didn't get a response, so closing. Please reopen if you are still having an issue in 1.0.

matthewp avatar Sep 07 '22 12:09 matthewp