-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #115 from OpenLiberty/staging
Merge staging to prod - Final issue 109 (#113)
- Loading branch information
Showing
4 changed files
with
94 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 39 additions & 41 deletions
80
finish/src/test/java/it/io/openliberty/guides/cors/TestData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,53 @@ | ||
// tag::comment[] | ||
// tag::copyright[] | ||
/******************************************************************************* | ||
* Copyright (c) 2017 IBM Corporation and others. | ||
* Copyright (c) 2017, 2023 IBM Corporation and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* are made available under the terms of the Eclipse Public License 2.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* http://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* Contributors: | ||
* IBM Corporation - Initial implementation | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*******************************************************************************/ | ||
// end::comment[] | ||
// end::copyright[] | ||
package it.io.openliberty.guides.cors; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public class TestData { | ||
|
||
public static String REQUEST_HEADER_ORIGIN = "Origin"; | ||
public static String REQUEST_HEADER_ACCESS_CONTROL_REQUEST_METHOD = "Access-Control-Request-Method"; | ||
public static String REQUEST_HEADER_ACCESS_CONTROL_REQUEST_HEADERS = "Access-Control-Request-Headers"; | ||
|
||
public static String RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN = "Access-Control-Allow-Origin"; | ||
public static String RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_CREDENTIALS = "Access-Control-Allow-Credentials"; | ||
public static String RESPONSE_HEADER_ACCESS_CONTROL_EXPOSE_HEADERS = "Access-Control-Expose-Headers"; | ||
public static String RESPONSE_HEADER_ACCESS_CONTROL_MAX_AGE = "Access-Control-Max-Age"; | ||
public static String RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_METHODS = "Access-Control-Allow-Methods"; | ||
public static String RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_HEADERS = "Access-Control-Allow-Headers"; | ||
|
||
public static Map<String, String> simpleRequestHeaders = new HashMap<String, String>(); | ||
public static Map<String, String> simpleResponseHeaders = new HashMap<String, String>(); | ||
|
||
public static Map<String, String> preflightRequestHeaders = new HashMap<String, String>(); | ||
public static Map<String, String> preflightResponseHeaders = new HashMap<String, String>(); | ||
|
||
static { | ||
simpleRequestHeaders.put(REQUEST_HEADER_ORIGIN, "openliberty.io"); | ||
|
||
simpleResponseHeaders.put(RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN, "openliberty.io"); | ||
simpleResponseHeaders.put(RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_CREDENTIALS, "true"); | ||
simpleResponseHeaders.put(RESPONSE_HEADER_ACCESS_CONTROL_EXPOSE_HEADERS, "MyHeader"); | ||
|
||
preflightRequestHeaders.put(REQUEST_HEADER_ORIGIN, "anywebsiteyoulike.com"); | ||
preflightRequestHeaders.put(REQUEST_HEADER_ACCESS_CONTROL_REQUEST_METHOD, "DELETE"); | ||
preflightRequestHeaders.put(REQUEST_HEADER_ACCESS_CONTROL_REQUEST_HEADERS, "MyOwnHeader2"); | ||
|
||
preflightResponseHeaders.put(RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN, "anywebsiteyoulike.com"); | ||
preflightResponseHeaders.put(RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_CREDENTIALS, "true"); | ||
preflightResponseHeaders.put(RESPONSE_HEADER_ACCESS_CONTROL_MAX_AGE, "10"); | ||
preflightResponseHeaders.put(RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_METHODS, "OPTIONS, DELETE"); | ||
preflightResponseHeaders.put(RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_HEADERS, "MyOwnHeader1, MyOwnHeader2"); | ||
} | ||
static final String ORIGIN = "Origin"; | ||
static final String AC_REQUEST_METHOD = "Access-Control-Request-Method"; | ||
static final String AC_REQUEST_HEADERS = "Access-Control-Request-Headers"; | ||
|
||
static final String AC_ALLOW_ORIGIN = "Access-Control-Allow-Origin"; | ||
static final String AC_ALLOW_CREDENTIALS = "Access-Control-Allow-Credentials"; | ||
static final String AC_EXPOSE_HEADERS = "Access-Control-Expose-Headers"; | ||
static final String AC_MAX_AGE = "Access-Control-Max-Age"; | ||
static final String AC_ALLOW_METHODS = "Access-Control-Allow-Methods"; | ||
static final String AC_ALLOW_HEADERS = "Access-Control-Allow-Headers"; | ||
|
||
static Map<String, String> simpleRequestHeaders = new HashMap<String, String>(); | ||
static Map<String, String> simpleResponseHeaders = new HashMap<String, String>(); | ||
|
||
static Map<String, String> preflightRequestHeaders = new HashMap<String, String>(); | ||
static Map<String, String> preflightResponseHeaders = new HashMap<String, String>(); | ||
|
||
static { | ||
simpleRequestHeaders.put(ORIGIN, "http://openliberty.io"); | ||
|
||
simpleResponseHeaders.put(AC_ALLOW_ORIGIN, "http://openliberty.io"); | ||
simpleResponseHeaders.put(AC_ALLOW_CREDENTIALS, "true"); | ||
simpleResponseHeaders.put(AC_EXPOSE_HEADERS, "MyHeader"); | ||
preflightRequestHeaders.put(ORIGIN, "anywebsiteyoulike.com"); | ||
preflightRequestHeaders.put(AC_REQUEST_METHOD, "DELETE"); | ||
preflightRequestHeaders.put(AC_REQUEST_HEADERS, "MyOwnHeader2"); | ||
|
||
preflightResponseHeaders.put(AC_ALLOW_ORIGIN, "anywebsiteyoulike.com"); | ||
preflightResponseHeaders.put(AC_ALLOW_CREDENTIALS, "true"); | ||
preflightResponseHeaders.put(AC_MAX_AGE, "10"); | ||
preflightResponseHeaders.put(AC_ALLOW_METHODS, "OPTIONS, DELETE"); | ||
preflightResponseHeaders.put(AC_ALLOW_HEADERS, "MyOwnHeader1, MyOwnHeader2"); | ||
} | ||
|
||
} |
80 changes: 39 additions & 41 deletions
80
start/src/test/java/it/io/openliberty/guides/cors/TestData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,53 @@ | ||
// tag::comment[] | ||
// tag::copyright[] | ||
/******************************************************************************* | ||
* Copyright (c) 2017 IBM Corporation and others. | ||
* Copyright (c) 2017, 2023 IBM Corporation and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* are made available under the terms of the Eclipse Public License 2.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* http://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* Contributors: | ||
* IBM Corporation - Initial implementation | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*******************************************************************************/ | ||
// end::comment[] | ||
// end::copyright[] | ||
package it.io.openliberty.guides.cors; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public class TestData { | ||
|
||
public static String REQUEST_HEADER_ORIGIN = "Origin"; | ||
public static String REQUEST_HEADER_ACCESS_CONTROL_REQUEST_METHOD = "Access-Control-Request-Method"; | ||
public static String REQUEST_HEADER_ACCESS_CONTROL_REQUEST_HEADERS = "Access-Control-Request-Headers"; | ||
|
||
public static String RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN = "Access-Control-Allow-Origin"; | ||
public static String RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_CREDENTIALS = "Access-Control-Allow-Credentials"; | ||
public static String RESPONSE_HEADER_ACCESS_CONTROL_EXPOSE_HEADERS = "Access-Control-Expose-Headers"; | ||
public static String RESPONSE_HEADER_ACCESS_CONTROL_MAX_AGE = "Access-Control-Max-Age"; | ||
public static String RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_METHODS = "Access-Control-Allow-Methods"; | ||
public static String RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_HEADERS = "Access-Control-Allow-Headers"; | ||
|
||
public static Map<String, String> simpleRequestHeaders = new HashMap<String, String>(); | ||
public static Map<String, String> simpleResponseHeaders = new HashMap<String, String>(); | ||
|
||
public static Map<String, String> preflightRequestHeaders = new HashMap<String, String>(); | ||
public static Map<String, String> preflightResponseHeaders = new HashMap<String, String>(); | ||
|
||
static { | ||
simpleRequestHeaders.put(REQUEST_HEADER_ORIGIN, "openliberty.io"); | ||
|
||
simpleResponseHeaders.put(RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN, "openliberty.io"); | ||
simpleResponseHeaders.put(RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_CREDENTIALS, "true"); | ||
simpleResponseHeaders.put(RESPONSE_HEADER_ACCESS_CONTROL_EXPOSE_HEADERS, "MyHeader"); | ||
|
||
preflightRequestHeaders.put(REQUEST_HEADER_ORIGIN, "anywebsiteyoulike.com"); | ||
preflightRequestHeaders.put(REQUEST_HEADER_ACCESS_CONTROL_REQUEST_METHOD, "DELETE"); | ||
preflightRequestHeaders.put(REQUEST_HEADER_ACCESS_CONTROL_REQUEST_HEADERS, "MyOwnHeader2"); | ||
|
||
preflightResponseHeaders.put(RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN, "anywebsiteyoulike.com"); | ||
preflightResponseHeaders.put(RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_CREDENTIALS, "true"); | ||
preflightResponseHeaders.put(RESPONSE_HEADER_ACCESS_CONTROL_MAX_AGE, "10"); | ||
preflightResponseHeaders.put(RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_METHODS, "OPTIONS, DELETE"); | ||
preflightResponseHeaders.put(RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_HEADERS, "MyOwnHeader1, MyOwnHeader2"); | ||
} | ||
static final String ORIGIN = "Origin"; | ||
static final String AC_REQUEST_METHOD = "Access-Control-Request-Method"; | ||
static final String AC_REQUEST_HEADERS = "Access-Control-Request-Headers"; | ||
|
||
static final String AC_ALLOW_ORIGIN = "Access-Control-Allow-Origin"; | ||
static final String AC_ALLOW_CREDENTIALS = "Access-Control-Allow-Credentials"; | ||
static final String AC_EXPOSE_HEADERS = "Access-Control-Expose-Headers"; | ||
static final String AC_MAX_AGE = "Access-Control-Max-Age"; | ||
static final String AC_ALLOW_METHODS = "Access-Control-Allow-Methods"; | ||
static final String AC_ALLOW_HEADERS = "Access-Control-Allow-Headers"; | ||
|
||
static Map<String, String> simpleRequestHeaders = new HashMap<String, String>(); | ||
static Map<String, String> simpleResponseHeaders = new HashMap<String, String>(); | ||
|
||
static Map<String, String> preflightRequestHeaders = new HashMap<String, String>(); | ||
static Map<String, String> preflightResponseHeaders = new HashMap<String, String>(); | ||
|
||
static { | ||
simpleRequestHeaders.put(ORIGIN, "http://openliberty.io"); | ||
|
||
simpleResponseHeaders.put(AC_ALLOW_ORIGIN, "http://openliberty.io"); | ||
simpleResponseHeaders.put(AC_ALLOW_CREDENTIALS, "true"); | ||
simpleResponseHeaders.put(AC_EXPOSE_HEADERS, "MyHeader"); | ||
preflightRequestHeaders.put(ORIGIN, "anywebsiteyoulike.com"); | ||
preflightRequestHeaders.put(AC_REQUEST_METHOD, "DELETE"); | ||
preflightRequestHeaders.put(AC_REQUEST_HEADERS, "MyOwnHeader2"); | ||
|
||
preflightResponseHeaders.put(AC_ALLOW_ORIGIN, "anywebsiteyoulike.com"); | ||
preflightResponseHeaders.put(AC_ALLOW_CREDENTIALS, "true"); | ||
preflightResponseHeaders.put(AC_MAX_AGE, "10"); | ||
preflightResponseHeaders.put(AC_ALLOW_METHODS, "OPTIONS, DELETE"); | ||
preflightResponseHeaders.put(AC_ALLOW_HEADERS, "MyOwnHeader1, MyOwnHeader2"); | ||
} | ||
|
||
} |