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

Social media URL validation doesn't work for Twitter URLs #9049

Closed
1 task done
tgoyne opened this issue Jul 25, 2019 · 8 comments
Closed
1 task done

Social media URL validation doesn't work for Twitter URLs #9049

tgoyne opened this issue Jul 25, 2019 · 8 comments
Labels
help wanted Help from new or existing contributors would be greatly appreciated!
Milestone

Comments

@tgoyne
Copy link
Contributor

tgoyne commented Jul 25, 2019

🌈

Twitter has recently started doing a thing where if you request a page using a browser user agent and no cookies, it replies with a 302 redirect to the same URL and some set-cookie headers. Making the same request again with the cookies then gives a 200 and the actual page contents, but HTTP.get_actual_url() ignores the cookies and only looks at the location header, resulting in a redirect loop. The end result is that pod validation gives WARN | url: The URL (https://twitter.com/realm) is not reachable. even though the URL works in a browser.

Some examples HTTP requests that give 200s:

$ curl 'https://twitter.com/realm'
$ curl 'https://twitter.com/realm' -H 'user-agent: Fake'
$  curl 'https://twitter.com/realm' -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36' -H 'cookie: rweb_optin=side_no_out'

HTTP requests that give 302s:

$ curl 'https://twitter.com/realm' -H 'user-agent: Safari'
@dnkoutso
Copy link
Contributor

Sure! Could use a bug fix here. Want to make a PR?

@dnkoutso dnkoutso added the help wanted Help from new or existing contributors would be greatly appreciated! label Jul 25, 2019
@dnkoutso
Copy link
Contributor

@dnkoutso
Copy link
Contributor

@abbeycode
Copy link
Contributor

@dnkoutso I took a stab at it with a couple PRs, modifying the two different files you mentioned above. #9053 depends on the CocoaPods/Core#571 PR

I'm motivated by one of my builds breaking because of this issue, which is why I targeted my PRs to the 1.7 stable branches for each project. I'm guessing the build for #9053 won't succeed without the other being merged. Is there a way to mark a different branch or revision as a dependency?

@dnkoutso
Copy link
Contributor

@abbeycode thanks, I dont think we will do a 1.7.6 for this, we are very close to 1.8.0.beta.1 so please target master on these PRs.

@paulb777
Copy link
Member

In case it's helpful for others, here's the workaround we're using for Firebase CI - https://github.com/firebase/firebase-ios-sdk/blob/master/scripts/pod_lib_lint.rb#L75

dnkoutso pushed a commit that referenced this issue Jul 30, 2019
* Using change from CocoaPods/Core#571 to address Issue #9049

* Fixed bug, added changelog entry, fixed style violations

* Updated non-browser user agent to 'CocoaPods'

* Added PR CocoaPods/Core#571 as dependency until it's merged

* Updated Gemfile to point to master branch for Core
@dnkoutso dnkoutso added this to the 1.8.0 milestone Jul 30, 2019
@abbeycode
Copy link
Contributor

@dnkoutso Is there a way to install CocoaPods into CI (Travis, for me) from master before the 1.8.0 beta is out?

@dnkoutso
Copy link
Contributor

Yes using Bundler https://guides.cocoapods.org/using/a-gemfile.html and https://bundler.io/

raphaelschaad added a commit to Flipboard/FLAnimatedImage that referenced this issue Jan 30, 2021
…haad) is not reachable."

Unresolved issue with Twitter URLs: CocoaPods/CocoaPods#9049

Fine to remove the link. Whatever you do, don't follow @raphaelschaad on Twitter :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Help from new or existing contributors would be greatly appreciated!
Projects
None yet
Development

No branches or pull requests

4 participants