]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/ping/HTTPFetch.java
upd: move external keywords to own class
[gigi.git] / src / org / cacert / gigi / ping / HTTPFetch.java
index a5755844a47636bc24396d7dd64af392f2772f75..1f31ccd633d19f0e00b91140852448b4e024230e 100644 (file)
@@ -8,6 +8,7 @@ import java.net.URL;
 
 import org.cacert.gigi.dbObjects.CertificateOwner;
 import org.cacert.gigi.dbObjects.Domain;
+import org.cacert.gigi.util.SystemKeywords;
 
 public class HTTPFetch extends DomainPinger {
 
@@ -15,10 +16,10 @@ public class HTTPFetch extends DomainPinger {
     public void ping(Domain domain, String expToken, CertificateOwner user, int confId) {
         try {
             String[] tokenParts = expToken.split(":", 2);
-            URL u = new URL("http://" + domain.getSuffix() + "/cacert-" + tokenParts[0] + ".txt");
+            URL u = new URL("http://" + domain.getSuffix() + "/" + SystemKeywords.HTTP_CHALLENGE_PREFIX + tokenParts[0] + ".txt");
             HttpURLConnection huc = (HttpURLConnection) u.openConnection();
             if (huc.getResponseCode() != 200) {
-                enterPingResult(confId, "error", "Invaild status code " + huc.getResponseCode() + ".", null);
+                enterPingResult(confId, "error", "Invalid status code " + huc.getResponseCode() + ".", null);
                 return;
             }
             BufferedReader br = new BufferedReader(new InputStreamReader(huc.getInputStream(), "UTF-8"));
@@ -31,7 +32,7 @@ public class HTTPFetch extends DomainPinger {
                 enterPingResult(confId, PING_SUCCEDED, "", null);
                 return;
             }
-            enterPingResult(confId, "error", "Challange tokens differed.", null);
+            enterPingResult(confId, "error", "Challenge tokens differed.", null);
             return;
         } catch (IOException e) {
             e.printStackTrace();