import java.io.IOException;
import java.net.HttpURLConnection;
-import java.net.URL;
import org.cacert.gigi.testUtils.ManagedTest;
import org.junit.Test;
@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"));
}