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

Specify User-Agent to get over my company's firewall #3628

Closed
igrep opened this issue Dec 6, 2017 · 3 comments · Fixed by #3682
Closed

Specify User-Agent to get over my company's firewall #3628

igrep opened this issue Dec 6, 2017 · 3 comments · Fixed by #3682

Comments

@igrep
Copy link
Contributor

igrep commented Dec 6, 2017

Problem

My colleagues and I are using stack behind a (weirdly) strong firewall, which denies http requests whose User-Agent header and the destination URL match with the preset white list, since the recent change by the infra team.
So I asked the infra team to add stack and s3.amazonaws.com (and so on) to the white list, but he declined because stack accesses to various domains without any User-Agent header!!

Solution

If you don't have a problem, I'll make a PR to add some User-Agent header ("The Haskell Stack" looks good.
So can you tell me where I should fix?

Version of stack I'm using

> stack --version
Version 1.5.1, Git revision 600c1f01435a10d127938709556c1682ecfd694e x86_64 hpack-0.17.1
@mgsloan
Copy link
Contributor

mgsloan commented Dec 6, 2017

Sure, this would be an appreciated PR! There are a fair number of places that do downloads. Searching for Network. should turn up most of the modules that do web requests.

@mgsloan mgsloan added this to the P2: Should milestone Dec 6, 2017
@igrep
Copy link
Contributor Author

igrep commented Dec 15, 2017

Now I'm trying to decide which functions to wrap.
Then, I have a question: Shouldn't I touch Hackage.Security.Client.Repository.HttpLib.HttpClient?
Because that module is said to be copied from the other. So is it better to keep as is?

@mgsloan
Copy link
Contributor

mgsloan commented Dec 15, 2017

@igrep You might need to make some changes to hackage-security itself, I'm not sure if it sets user-agent.

igrep added a commit to igrep/stack that referenced this issue Dec 20, 2017
Fix: commercialhaskell#3628

Wrap up functions in `Network.HTTP.Client` and `Network.HTTP.Simple` to
add User-Agent to the request object.
igrep added a commit to igrep/stack that referenced this issue Dec 20, 2017
Fix: commercialhaskell#3628

Wrap up functions in `Network.HTTP.Client` and `Network.HTTP.Simple` to
add User-Agent to the request object.
mgsloan added a commit that referenced this issue Dec 23, 2017
Specify User-Agent on every HTTP request (#3628)
igrep added a commit to igrep/stack that referenced this issue Dec 26, 2017
mgsloan added a commit that referenced this issue Dec 27, 2017
Add hlint rules to prevent regression of #3628
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants