Skip to content

Conversation

@pdelong42
Copy link

This is another attempt to fix the issue in #23.

It took me a while to gather up the nerve to submit this, as I am also really new to Clojure, and have never submitted a pull request before.

I tried to keep the changes as minimal as possible, but I couldn't avoid pulling in an extra dependency.

Paul DeLong added 3 commits October 1, 2014 23:36
"Java/1.6.0_65"; but I get a 200 response when I use "clj-http.client/get",
which has a User-Agent of "Apache-HttpClient/4.3.5 (java 1.5)".  I'm not sure
why this is the case, because HN doesn't seem to have a problem with me setting
the User-Agent to either "Java" or "foo" as the value.

Amendment: I did a quick search, and learned that sites have been specifically
blocking User-Agents of the form "Java/xyz" for a while now, because this is
typically the signature of bots that don't want to play nice and identify
themselves.  In light of this, I find it strange that Clojure doesn't set the
user-agent to something else for its "slurp" function.
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.

1 participant