1616
1717package net .sourceforge .jnlp .runtime ;
1818
19+ import net .adoptopenjdk .icedteaweb .JavaSystemPropertiesConstants ;
1920import net .adoptopenjdk .icedteaweb .jnlp .element .resource .ExtensionDesc ;
2021import net .adoptopenjdk .icedteaweb .jnlp .element .resource .PropertyDesc ;
2122import net .adoptopenjdk .icedteaweb .jnlp .element .security .SecurityDesc ;
@@ -143,9 +144,6 @@ private void installEnvironment() {
143144 }
144145
145146 private void setSystemPropertiesFromJnlp () {
146- if ("true" .equalsIgnoreCase (System .getenv (IGNORE_JNLP_RESOURCE_PROPERTIES ))) {
147- return ;
148- }
149147 final List <PropertyDesc > props = collectPropertiesFromJnlpHierarchy (new ArrayList <>(), file );
150148
151149 if (!(props .size () == 0 )) {
@@ -158,8 +156,11 @@ private void setSystemPropertiesFromJnlp() {
158156
159157 final PrivilegedAction <Object > setPropertiesAction = () -> {
160158 for (PropertyDesc propDesc : props ) {
161- LOG .debug ("Setting System Property {} with value {}" , propDesc .getKey (), propDesc .getValue ());
162- System .setProperty (propDesc .getKey (), propDesc .getValue ());
159+ if (!propDesc .getKey ().equals (JavaSystemPropertiesConstants .HTTP_AGENT )) {
160+ setSystemProperty (propDesc );
161+ } else if (!"true" .equalsIgnoreCase (System .getenv (ApplicationInstance .IGNORE_JNLP_RESOURCE_PROPERTIES ))) {
162+ setSystemProperty (propDesc );
163+ }
163164 }
164165 return null ;
165166 };
@@ -169,6 +170,11 @@ private void setSystemPropertiesFromJnlp() {
169170 }
170171 }
171172
173+ private void setSystemProperty (PropertyDesc propDesc ) {
174+ LOG .debug ("Setting System Property {} with value {}" , propDesc .getKey (), propDesc .getValue ());
175+ System .setProperty (propDesc .getKey (), propDesc .getValue ());
176+ }
177+
172178 /**
173179 * Returns the jnlpfile on which is this application based
174180 * @return JNLP file for this task.
0 commit comments