Skip to content
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

Fixes #1194: OEmbed http requests use "request" npm package #2555

Merged
merged 7 commits into from Mar 28, 2016
Merged

Fixes #1194: OEmbed http requests use "request" npm package #2555

merged 7 commits into from Mar 28, 2016

Conversation

ghost
Copy link

@ghost ghost commented Mar 18, 2016

Closes #1194

OEmbed http requests use "request" npm package instead of official node modules.

@engelgabriel
Copy link
Member

Thanks @nishimaki10
@rodrigok can you review this?

@rodrigok
Copy link
Member

@nishimaki10 awesome, but I have some questions.

Why not use the Meteor's HTTP module http://docs.meteor.com/#/full/http_call ?

Is there some way to limit the request size? Users can past URL of big files and we don't wan't to download the entire file to get only the headers.

@ghost
Copy link
Author

ghost commented Mar 19, 2016

@rodrigok Thanks for review!

I have used for the Meteor first time. I did not know that exists Meteor's HTTP module. Thank you for the valuable information.

But, may not be able to implement limit the request size. We have to control the request stream. It's probably like this. I looking at this, it is impossible to touch the stream.

What should I do?

@rodrigok
Copy link
Member

@nishimaki10 If you can limit the request using the lib request go ahead and use it, but use the internal one HTTPInternals.NpmModules.request.module. What do you think?

@ghost
Copy link
Author

ghost commented Mar 19, 2016

@rodrigok I see. I will try to implement using the HTTPInternals.NpmModules.request.module. Thanks!

@engelgabriel engelgabriel modified the milestone: 0.24.0 Mar 21, 2016
stream.abort()

stream.on 'end', Meteor.bindEnvironment ->
buffer = Buffer.concat(chunks)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the gunzip? The library do the unzip for each chunk? I don't think so, can you test?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. The request module pipe gunzip for each chunk. see also. I think that this library is made well.
My Test:
gziped site
Screenshot:
screenshot-localhost 3000 2016-03-23 07-04-02

@ghost
Copy link
Author

ghost commented Mar 24, 2016

Twitter, GitHub, etc, etc... I tested many sites. All OK.
The content-encoding: gzip header exists properly in response if site enabled gzip. e.g. Twitter, GitHub.
Thanks.

@rodrigok
Copy link
Member

LGTM

@rodrigok
Copy link
Member

@nishimaki10 sorry about that, but, can you fix the conflicts?

@ghost
Copy link
Author

ghost commented Mar 28, 2016

@rodrigok OK, solved.

@rodrigok rodrigok merged commit 1ec885c into RocketChat:develop Mar 28, 2016
@ghost ghost deleted the oembed-replace-request branch March 31, 2016 10:57
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