-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JUNIT: Migrate assets dispatcher test to Kotlin #1341
Conversation
// Setting the "Origin: header" must be allowed by -Dsun.net.http.allowRestrictedHeaders=true | ||
HttpURLConnection c = new URL("http://localhost:9999/system/ok").openConnection() | ||
c.addRequestProperty("Origin", "TEST") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Setting the "Origin: header" must be allowed by -Dsun.net.http.allowRestrictedHeaders=true | |
HttpURLConnection c = new URL("http://localhost:9999/system/ok").openConnection() | |
c.addRequestProperty("Origin", "TEST") | |
HttpURLConnection c = new URL("http://localhost:9999/system/ok").openConnection() | |
// Setting the "Origin" header must be allowed by system property sun.net.http.allowRestrictedHeaders=true | |
c.addRequestProperty("Origin", "TEST") |
@@ -16,8 +16,7 @@ class CORSSpec extends BaseSpecification { | |||
|
|||
def "expect 'Access-Control-Allow-Origin' for requests with 'origin'"() { | |||
when: | |||
// Allow us to set the Origin: header... | |||
System.setProperty("sun.net.http.allowRestrictedHeaders", "true") | |||
// Setting the "Origin: header" must be allowed by -Dsun.net.http.allowRestrictedHeaders=true | |||
HttpURLConnection c = new URL("http://localhost:9999/system/ok").openConnection() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional: Rename c
to connection
fun `proper caching set for all kind of assets and cache-control URIs`(uri: String, header: String) { | ||
val connection = URL("http://localhost:9999" + uri).openConnection() | ||
assertEquals(header, connection.getHeaderField(HttpHeaderNames.CACHE_CONTROL.toString())) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional: Remove empty line
No description provided.