Skip to content

Conversation

mhluska
Copy link

@mhluska mhluska commented Mar 28, 2018

This is lightly tested on my local machine. I think we need to add this because the initial FastBoot request is missing a content-type header. See my issue here: ember-fastboot/fastboot-app-server#78

This is important because some Node-based crawlers simply break without a content-type header. Also Twitterbot doesn't seem to be able to get meta tags when this header is not present.

@jimsynz
Copy link

jimsynz commented Jun 8, 2018

I had a user report to me that Safari just downloads the HTML file immediately and I believe this is because my site has the X-Content-Type-Options header set to nosniff. 😞

@mhluska
Copy link
Author

mhluska commented Oct 10, 2018

I've realized this is only needed in the chunkedResponse case. I've updated the PR.

@mhluska
Copy link
Author

mhluska commented Oct 10, 2018

Note: I still had to add this in fastboot-app-server to get things working in production 🤷‍♂️ :

// HACK: When using `chunkedResponse` we have to explicitly set the content
// type otherwise the header is missing.
app.use(function(req, res, next) {
  if (!req.url.includes('.')) {
    res.type('html');
  }
  next();
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants