Comments (3)
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 http.agent
once the class was loaded would not be honored (otherwise it makes little sense to have a setGlobalUserAgent
, not to talk of considerations about performance and consistency across requests).
Would that fit your needs?
from echosvg.
Github closed this automatically after my commit, reopening so you can comment on the applied solution and possible further cleanups.
from echosvg.
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 final
).
from echosvg.
Related Issues (20)
- SamplesRenderingTest is too heavy
- Java heap space error when running tests HOT 2
- `PNGImageEncoder` closes the output stream
- Build size, options, documentation HOT 5
- Release 1.1
- The SVG 1.2 dom implementation fails to load the user agent stylesheet HOT 1
- Do not assume that `GRADLE_USER_HOME` is inside `user.home` in policy files
- Replace Xalan's XPath with the JDK version
- Support Level 4 CSS Color (and Level 5 `color-mix()`) values in sRGB gamut HOT 4
- Error handling in CSS value processing is non-conformant HOT 1
- BridgeException: Cannot find the referenced element HOT 1
- Root element namespace does not match that requested HOT 20
- EchoSVG on Android HOT 6
- XMLReader HOT 7
- SVG scale problem while painting
- Add images from canvg's test suite HOT 4
- GraphicsNode and opacity HOT 1
- Publish to Maven Central HOT 4
- Arbitrary file access during archive extraction ("Zip Slip") [VERY LOW IMPACT]
- Remove Apache xmlgraphics-commons HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from echosvg.