-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FastBoot still renders the body on redirect #802
Comments
Hello @SergeAstapov can you provide a recreation of this issue. I would be happy to jump on a call to understand your issues. |
Hi @kiwiupover! Sorry for delay, link to simple reproduction is https://github.com/SergeAstapov/fastboot-repro-802 Actual steps to minimal reproduction are simple, here is the commit which adds two routes where A route does redirect to B route. I added The rendered html from Ember gets ignored and simple redirect message returned by Result here. Ideally, I would expect Ember not to follow redirects in FastBoot mode and do not render any DOM in FastBoot mode for redirects as it's simply ignored and not used for the response. |
Hi @kiwiupover! Given the above explanation and reproduction, do you have enough information on the issue? Happy to provide more info if needed. For the future readers should they end up in the same situation: Currently we end up setting a flag on
given
and then in
|
@SergeAstapov @kiwiupover just hit this same error when adding a redirect for a base route... and it exposes my prod s3 bucket when fastboot returns the redirect body from above! Ideally I'd like to not have to wrap my application in a flag, is there a settled way to handle this in 2021? router.js
going to edit: after looking at the source code, found a way around it.
for redirects visit().then((response) => response.html()) hits L40 so essentially you have to do something like this
not sure how common it is to render fastboot page manually like this but perhaps an optional arg to html() to render redirects could be helpful Additionally this is in the context of rendering a fastboot app inside a cloud cdn and not through a node server. edit 2the above didn't work as I naively didn't realize I was only getting the html body from so far the only thing I can think of is a monkey patch/hack
could open a pr |
Looks like it's a miss in the implementation as outlined in #195 (comment):
fastboot
library does not include body for redirects, implemented in commit ember-fastboot/fastboot@3f386fd.Since then lot of things have changed in Ember rendering engine and I hope this is feasible/possible to implement to tell Ember not to render anything.
Looks like
shouldRender
configuration option would result in desired outcome but it's set too early in bootstrap phase.Any other ideas?
The text was updated successfully, but these errors were encountered: