File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
core/src/main/java/net/sourceforge/jnlp/runtime Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 4646import javax .swing .UIManager ;
4747import java .io .File ;
4848import java .net .URL ;
49+ import java .net .CookieManager ;
50+ import java .net .CookiePolicy ;
51+ import java .net .CookieHandler ;
4952import java .security .AccessController ;
5053import java .security .PrivilegedAction ;
5154import java .util .Arrays ;
@@ -111,6 +114,24 @@ public static void main(String[] args) {
111114 int status = -42 ;
112115 try {
113116 EnvironmentPrinter .logEnvironment (args );
117+
118+ // Enabling java.net built-in support of HTTP cookies.
119+ // HTTP cookies will be stored in-memory until the java process dies.
120+ // CookiePolicy.ACCEPT_ALL is necessary to manage the cookies associated
121+ // to a parent domain of the requested url domain.
122+ //
123+ // Example:
124+ // if an HTTP response on "https://prefix.domain.extension/app/jws-store/some-package.jar" contains:
125+ // - 1 cookie set on "prefix.domain-name.extension" domain
126+ // - 1 cookie set on "*.domain-name.extension" domain
127+ // CookiePolicy.ACCEPT_ALL ensures that both cookie will be send back in the next HTTP queries
128+ // sent to the "prefix.domain-name.extension" domain, whereas CookiePolicy.ACCEPT_ORIGINAL_SERVER will filter
129+ // the cookie set on "*.domain-name.extension" domain.
130+
131+ CookieManager cookieManager = new CookieManager ();
132+ cookieManager .setCookiePolicy (CookiePolicy .ACCEPT_ALL );
133+ CookieHandler .setDefault (cookieManager );
134+
114135 status = mainWithReturnCode (args );
115136 } finally {
116137 if (status != 0 ) {
You can’t perform that action at this time.
0 commit comments