This is an exported version of the JIRA issue tracker. Please use the Google Code site to open new tickets or report updates to these existing tickets. Feel free to contact the mailing list with any questions.

[NRB-5] User-Agent setting doesn't work
Created: Mon, 26 Sep 2005 12:09:28 -0700 (PDT)  Updated: Mon, 26 Sep 2005 12:27:55 -0700 (PDT)

Status:Closed
Project:Norbert
Component/s:
Affects Version/s:0.3
Fix Version/s:0.3.1

Type:BugPriority: Major
Reporter:Henri YandellAssignee:Henri Yandell
Resolution:Fixed 
Environment:


 Description   
Tim Patton writes:

"I downloaded norbert recently and noticed it does not send the user-agent correctly even when it has been set. I've included a fix for this problem below. I think the problem was that httpUrlConn was never being used once it was created. "

(snipped code)
Comment by bayard [ Mon, 26 Sep 2005 12:27:55 -0700 (PDT) ]
Fix submitted:

URLConnection urlConn = url.openConnection();
if(urlConn instanceof HttpURLConnection) {
    if(userAgent != null) {
        ((HttpURLConnection)urlConn).addRequestProperty("User-Agent", userAgent);
    }
}