]> WPIA git - gigi.git/blobdiff - tests/org/cacert/gigi/TestSecurityHeaders.java
Merge "Suggestions to enhance the SQL call pattern."
[gigi.git] / tests / org / cacert / gigi / TestSecurityHeaders.java
index 16f4f3a08580c4d7f5b50d00038b63b8b2cd0b72..8149d322a22f21d917aeb91749630e701cc072e8 100644 (file)
@@ -4,7 +4,6 @@ import static org.junit.Assert.*;
 
 import java.io.IOException;
 import java.net.HttpURLConnection;
-import java.net.URL;
 
 import org.cacert.gigi.testUtils.ManagedTest;
 import org.junit.Test;
@@ -13,17 +12,17 @@ public class TestSecurityHeaders extends ManagedTest {
 
     @Test
     public void testSTS() throws IOException {
-        HttpURLConnection uc = (HttpURLConnection) new URL("https://" + getServerName()).openConnection();
+        HttpURLConnection uc = get(null, "/");
         assertNotNull(uc.getHeaderField("Strict-Transport-Security"));
     }
 
     public void testCSP() throws IOException {
-        HttpURLConnection uc = (HttpURLConnection) new URL("https://" + getServerName()).openConnection();
+        HttpURLConnection uc = get(null, "/");
         assertNotNull(uc.getHeaderField("Content-Security-Policy"));
     }
 
     public void testAllowOrigin() throws IOException {
-        HttpURLConnection uc = (HttpURLConnection) new URL("https://" + getServerName()).openConnection();
+        HttpURLConnection uc = get(null, "/");
         assertNotNull(uc.getHeaderField("Access-Control-Allow-Origin"));
 
     }