Skip to content

Commit

Permalink
prototype redirect code which might be used to redirect in the future
Browse files Browse the repository at this point in the history
  • Loading branch information
eviltester committed Mar 23, 2024
1 parent 9d8d2ea commit b7c8134
Showing 1 changed file with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@

import java.io.*;
import java.lang.reflect.Array;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;

import static spark.Spark.after;
import static spark.Spark.get;
import static spark.Spark.*;

public class ChallengerWebGUI {

Expand Down Expand Up @@ -72,6 +73,25 @@ public void setup(final Challengers challengers,
// return "";
// });

// could redirect to eviltester.com if the canonical doesn't change the search indexing from heroku to eviltester
// before((request, response) -> {
//
// if (request.requestMethod().equals("GET")) {
// if (request.url().startsWith("http://apichallenges.herokuapp.com") ||
// request.url().startsWith("https://apichallenges.herokuapp.com")
// ) {
// // and it is a browser request
// if (request.headers("accept").contains("text/html")) {
// // then redirect
// response.header("location", "https://apichallenges.eviltester.com" + request.uri());
// halt(301);
// }
// } else {
// System.out.println("nothing to see here");
// }
// }
// }
// );

// single user / default session
get("/gui/challenges", (request, result) -> {
Expand Down

0 comments on commit b7c8134

Please sign in to comment.