Skip to content

Commit a2ab17b

Browse files
committed
OWS-631: only block http agent property and not all properties from the JNLP file
1 parent 28614e5 commit a2ab17b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

core/src/main/java/net/sourceforge/jnlp/JNLPFile.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ protected JNLPFile() {
261261

262262
final String httpAgent = getResources().getPropertiesMap().get(HTTP_AGENT);
263263
// Do not set http.agent in stage 2 as it can be set from the vmarg to the jvm
264-
if (! StringUtils.isBlank(httpAgent) && !"true".equalsIgnoreCase(System.getenv(ApplicationInstance.IGNORE_JNLP_RESOURCE_PROPERTIES))) {
264+
if (! StringUtils.isBlank(httpAgent) && !"true".equalsIgnoreCase(System.getenv(ApplicationInstance.IGNORE_HTTP_AGENT_PROPERTY))) {
265265
System.setProperty(HTTP_AGENT, httpAgent);
266266
if (!HttpURLConnection.userAgent.contains(httpAgent)) {
267267
LOG.warn("Cannot set HTTP User-Agent as a connection has been opened before reading the JNLP file");

core/src/main/java/net/sourceforge/jnlp/runtime/ApplicationInstance.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public class ApplicationInstance {
5454

5555
private static final String DEPLOYMENT_SYSPROP = "deployment.javaws";
5656
private static final String DEPLOYMENT_SYSPROP_VALUE = "IcedTea-Web";
57-
public static final String IGNORE_JNLP_RESOURCE_PROPERTIES = "ignoreJnlpResourceProperties";
57+
public static final String IGNORE_HTTP_AGENT_PROPERTY = "ignoreHttpAgentProperty";
5858

5959
// todo: should attempt to unload the environment variables
6060
// installed by the application.
@@ -158,7 +158,7 @@ private void setSystemPropertiesFromJnlp() {
158158
for (PropertyDesc propDesc : props) {
159159
if (!propDesc.getKey().equals(JavaSystemPropertiesConstants.HTTP_AGENT)) {
160160
setSystemProperty(propDesc);
161-
} else if (!"true".equalsIgnoreCase(System.getenv(ApplicationInstance.IGNORE_JNLP_RESOURCE_PROPERTIES))) {
161+
} else if (!"true".equalsIgnoreCase(System.getenv(ApplicationInstance.IGNORE_HTTP_AGENT_PROPERTY))) {
162162
setSystemProperty(propDesc);
163163
}
164164
}

0 commit comments

Comments
 (0)