I’m currently building an Heroku addon and the admin dashboard is using Ember. To check our compatibility with Heroku we’re using their kensa tool.
In order to test the SSO part, kensa is sending a POST request toa URL you provide. The endpoint it contacts is on our API that redirects to our dashboard in case of success.
To verify the success of the operation, kensa follows the redirection with a GET request, providing the following header: Accept: */*. In order to make all of this work, we used Fastboot but the problem is that Fastboot only answers if Accept: text/html is passed.
Is there any way to make Fastboot answer when Accept is a wildcard? I know it’s getting handled by Express, I saw it with DEBUG=express:* ember serve but I don’t know what to change to make it work.
If you’re running with Ember CLI (ember s) then you can add an express middleware that re-writes your accept headers to text/html for fastboot. We do something similar for Twitterbot testing.
Currently I’m talking about the dev server but if @ryanto’s solution works for both I’m all-in. I’ve only check in development so far but I suppose it will work in prod
It won’t work in prod since you most likely aren’t using Ember CLI to serve production pages. If you are, take a look at FastbootAppServer or the Fastboot express middleware, both of these are made for production. With these rewriting the accept header shouldn’t be required.
That said if you’re having trouble with prod post here, I’m sure it can be figured out
This thread is a tad bit old, but google has brought me here multiple times today.
I’m experiencing the same, but the middleware is not picking up. It looks like something has changed in the format, but the generator still creates that scaffolding. Ember adds the following message:
The following options have been renamed — please update your config: exports → output.exports
What is the purpose of this selective header issue anyway?