Skip to content

Conversation

timbrandin
Copy link

Look for text/html in the content type on the request to better decide 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);
Copy link
Member

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?

Copy link
Author

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.

@arunoda
Copy link
Member

arunoda commented May 1, 2015

I've another suggestion to make this work.

  • List add a meta tag to the HTML page via this package (means simply add .html file)
  • Then let's check whether that exists or not
  • If that's exists, it's rendered via Meteor

Does that suits with your use case?

@timbrandin
Copy link
Author

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 _escaped_fragment_ requests.

@timbrandin
Copy link
Author

I wonder if you get the script tag on SSR for E-mail too?

@arunoda
Copy link
Member

arunoda commented May 1, 2015

Okay. Then let's do a check for the URL for _escaped_fragment_ too.

@timbrandin
Copy link
Author

The URL doesn't seem to be available in the current context. Any ideas?

@arunoda
Copy link
Member

arunoda commented May 1, 2015

Yes. Then let's do that check in the fast-render.

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