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

URL Preview should support 3xx URL redirection #1412

Closed
luozengbin opened this issue Nov 15, 2015 · 4 comments
Closed

URL Preview should support 3xx URL redirection #1412

luozengbin opened this issue Nov 15, 2015 · 4 comments

Comments

@luozengbin
Copy link

https://github.com/RocketChat/Rocket.Chat/blob/develop/packages/rocketchat-oembed/server/server.coffee#L34

302 and 307 with 301 similar behavior, I think the 302 and 307 should also be supported.

302 Moved Temporarily
307 Temporary Redirect

@sampaiodiego
Copy link
Member

it's a simple task and it could generate preview for even more URLs..

@rodrigok any thoughts?

@rodrigok
Copy link
Member

@sampaiodiego agreed, can you do that?

@kakawait
Copy link
Contributor

Simply update https://github.com/RocketChat/Rocket.Chat/blob/develop/packages/rocketchat-oembed/server/server.coffee#L34 to add 302 and 307 status.

using Coffeescript style

if response.statusCode in [301, 302, 307] and response.headers.location?

or by using undescore function

if _.contains([301, 302, 307], response.statusCode) and response.headers.location?

@sampaiodiego
Copy link
Member

closed by #1597

engelgabriel added a commit that referenced this issue Dec 9, 2015
# By matthewmawby (2) and others
# Via Gabriel Engel (2) and others
* 'develop' of github.com:RocketChat/Rocket.Chat:
  fixes blockquote non-continous border - closes #1605
  Removed trash can icon
  tabbed added code
  Added the code to fix issue #1579
  Added in functionality recommended in issue #1412
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants