Stack: Specify User-Agent to get over my company's firewall

Created on 6 Dec 2017  ·  3Comments  ·  Source: commercialhaskell/stack

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
enhancement

Most helpful comment

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.

All 3 comments

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.

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?

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

Was this page helpful?
0 / 5 - 0 ratings