Skip to content
Snippets Groups Projects
Commit 25c5001f authored by Rucha Deshpande's avatar Rucha Deshpande
Browse files

Reverting httpResponse.flushbuffer() in RegisterFilter

commit b5c7d018 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Mon Oct 12 2020 14:17:34 GMT-0500 (Central Daylight Time) 

    Reverting httpResponse.flushbuffer() in RegisterFilter
parent e718ddf7
No related branches found
No related tags found
1 merge request!27Feat/aws impl3
...@@ -44,7 +44,6 @@ public class RegisterFilter implements Filter { ...@@ -44,7 +44,6 @@ public class RegisterFilter implements Filter {
httpResponse.addHeader(header.getKey(), header.getValue().toString()); httpResponse.addHeader(header.getKey(), header.getValue().toString());
} }
httpResponse.addHeader(DpsHeaders.CORRELATION_ID, this.headers.getCorrelationId()); httpResponse.addHeader(DpsHeaders.CORRELATION_ID, this.headers.getCorrelationId());
httpResponse.flushBuffer();
if (!validateIsHttps(httpResponse)) { if (!validateIsHttps(httpResponse)) {
//do nothing //do nothing
} else if (httpRequest.getMethod().equalsIgnoreCase(OPTIONS_STRING)) { } else if (httpRequest.getMethod().equalsIgnoreCase(OPTIONS_STRING)) {
......
...@@ -73,8 +73,8 @@ public abstract class BaseTestTemplate extends TestBase { ...@@ -73,8 +73,8 @@ public abstract class BaseTestTemplate extends TestBase {
ClientResponse response = descriptor.run(getId(), testUtils.getNoDataAccessToken()); ClientResponse response = descriptor.run(getId(), testUtils.getNoDataAccessToken());
assertEquals(error(response.getEntity(String.class)), 401, response.getStatus()); assertEquals(error(response.getEntity(String.class)), 401, response.getStatus());
} }
//Commenting this test.. . See Gitlab issue: https://community.opengroup.org/osdu/platform/system/register/-/issues/20
/*
@Test @Test
public void should_return20X_when_usingCredentialsWithPermissionOps() throws Exception { public void should_return20X_when_usingCredentialsWithPermissionOps() throws Exception {
should_return20X_when_usingCredentialsWithPermission(testUtils.getOpsAccessToken()); should_return20X_when_usingCredentialsWithPermission(testUtils.getOpsAccessToken());
...@@ -93,14 +93,14 @@ public abstract class BaseTestTemplate extends TestBase { ...@@ -93,14 +93,14 @@ public abstract class BaseTestTemplate extends TestBase {
assertEquals("[true]", response.getHeaders().getFirst("Access-Control-Allow-Credentials")); assertEquals("[true]", response.getHeaders().getFirst("Access-Control-Allow-Credentials"));
assertEquals("DENY", response.getHeaders().getFirst("X-Frame-Options")); assertEquals("DENY", response.getHeaders().getFirst("X-Frame-Options"));
assertEquals("1; mode=block", response.getHeaders().getFirst("X-XSS-Protection")); assertEquals("1; mode=block", response.getHeaders().getFirst("X-XSS-Protection"));
assertTrue(( response.getHeaders().getFirst("X-Content-Type-Options").equals("nosniff")) || ( response.getHeaders().getFirst("X-Content-Type-Options").equals("[nosniff]"))); assertEquals("nosniff", response.getHeaders().getFirst("X-Content-Type-Options"));
assertEquals("[no-cache, no-store, must-revalidate]", response.getHeaders().getFirst("Cache-Control")); assertEquals("[no-cache, no-store, must-revalidate]", response.getHeaders().getFirst("Cache-Control"));
assertEquals("[default-src 'self']", response.getHeaders().getFirst("Content-Security-Policy")); assertEquals("[default-src 'self']", response.getHeaders().getFirst("Content-Security-Policy"));
assertEquals("[max-age=31536000; includeSubDomains]", response.getHeaders().getFirst("Strict-Transport-Security")); assertEquals("[max-age=31536000; includeSubDomains]", response.getHeaders().getFirst("Strict-Transport-Security"));
assertEquals("[0]", response.getHeaders().getFirst("Expires")); assertEquals("[0]", response.getHeaders().getFirst("Expires"));
assertEquals(error(response.getStatus() == 204 ? "" : response.getEntity(String.class)), expectedOkResponseCode(), response.getStatus()); assertEquals(error(response.getStatus() == 204 ? "" : response.getEntity(String.class)), expectedOkResponseCode(), response.getStatus());
} }
*/
@Test @Test
public void should_returnOk_when_makingHttpOptionsRequest() throws Exception { public void should_returnOk_when_makingHttpOptionsRequest() throws Exception {
ClientResponse response = descriptor.runOptions(getId(), testUtils.getOpsAccessToken()); ClientResponse response = descriptor.runOptions(getId(), testUtils.getOpsAccessToken());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment