← Back to index
|
Original Bugzilla link
Bug 11879 – missing default User-Agent in std.net.curl
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-01-07T16:14:00Z
Last change time
2014-01-13T02:28:48Z
Assigned to
nobody
Creator
code
Comments
Comment #0
by code — 2014-01-07T16:14:44Z
The W3C standard says "User agents SHOULD include this field with requests."
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.43
Some APIs will reject requests without a User-Agent. Most notably
https://api.github.com
will return a 403 and the following message. Request forbidden by administrative rules. Please make sure your request has a User-Agent header (
http://developer.github.com/v3/#user-agent-required).
Check
https://developer.github.com
for other possible causes. I think we should chose a default value for this field like most other libraries.
http://www.useragentstring.com/pages/Librarielist/
How about "Phobos-std.net.curl/2.064 (libcurl/7.32.0)"?
Comment #1
by code — 2014-01-07T16:15:34Z
I forgot to mention, the problem is very hard to debug, especially over an encrypted connection.
Comment #2
by bugzilla — 2014-01-13T02:27:41Z
https://github.com/D-Programming-Language/phobos/pull/1847
Comment #3
by github-bugzilla — 2014-01-13T02:28:34Z
Commits pushed to master at
https://github.com/D-Programming-Language/phobos
https://github.com/D-Programming-Language/phobos/commit/b84b43ff5de7577c05578eccd6c4bd12352fff0c
fix Issue 11879 - missing default User-Agent in std.net.curl - use "Phobos-std.net.curl/2.065 (libcurl/7.32.0)" as default "User-Agent" - add method to set a different user agent
https://github.com/D-Programming-Language/phobos/commit/9cb7cabc5954b5dc7443d85bc69692564ec3d771
Merge pull request #1847 from MartinNowak/fix11879 fix Issue 11879 - missing default User-Agent in std.net.curl