[NRB-5] User-Agent setting doesn't work | |
| Status: | Closed |
| Project: | Norbert |
| Component/s: | |
| Affects Version/s: | 0.3 |
| Fix Version/s: | 0.3.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Henri Yandell | Assignee: | 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); } } |