-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ParsedURL does not respect http.agent system property #2
Comments
I'm thinking of something like this: @@ -83,11 +83,15 @@ public class ParsedURL {
* The default protocol handler. This handler is used when other handlers fail
* or no match for a protocol can be found.
*/
private static ParsedURLProtocolHandler defaultHandler = new ParsedURLDefaultProtocolHandler();
- private static String globalUserAgent = "EchoSVG/0.1";
+ private static String globalUserAgent;
+
+ static {
+ globalUserAgent = System.getProperty("http.agent", "EchoSVG/0.1");
+ }
public static String getGlobalUserAgent() {
return globalUserAgent;
} That is, changes to Would that fit your needs? |
Github closed this automatically after my commit, reopening so you can comment on the applied solution and possible further cleanups. |
Looks good. Ideally, we could migrate classes towards immutability, which is more of a clean-up item than a bug fix (e.g., make the global user agent |
See: https://issues.apache.org/jira/browse/BATIK-1300
The fix is to change
org.apache.batik.util.ParsedURL
, around line 90, to setglobalUserAgent
using thehttp.agent
value. If thehttp.agent
value is not set, fall back to a default (e.g., maintain backwards comparability).The text was updated successfully, but these errors were encountered: