-
Notifications
You must be signed in to change notification settings - Fork 27
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
Inject data only when renders via Meteor #2
base: master
Are you sure you want to change the base?
Conversation
…e when to inject fast render data.
@@ -26,7 +26,8 @@ http.OutgoingMessage.prototype.write = function(chunk, encoding) { | |||
var condition = | |||
this._injectPayload && !this._injected && | |||
encoding === undefined && | |||
/<!DOCTYPE html>/.test(chunk); | |||
/<!DOCTYPE html>/.test(chunk) && | |||
/Content-Type: text\/html/.test(this._header); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this correct? Seems bit confusing to me?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, a bit odd. But it works with SSR with _escaped_fragment_
this way.
I've another suggestion to make this work.
Does that suits with your use case? |
Oh, yeah that would work. I guess in my use case I'm still rendering via Meteor but don't want the big script tag for |
I wonder if you get the script tag on SSR for E-mail too? |
Okay. Then let's do a check for the URL for |
The URL doesn't seem to be available in the current context. Any ideas? |
Yes. Then let's do that check in the fast-render. |
Look for text/html in the content type on the request to better decide when to inject fast render data.