Package org.vertx.java.core.http

Examples of org.vertx.java.core.http.CaseInsensitiveMultiMap


            public void handle(YokeRequest request) {
                request.response().end("hello");
            }
        });

        MultiMap headers = new CaseInsensitiveMultiMap();
        headers.add("x-forwarded-proto", "https");

        new YokeTester(app).request("GET", "/", headers, new Handler<Response>() {
            @Override
            public void handle(Response response) {
                assertEquals(response.headers().get("Strict-Transport-Security"), "max-age=15768000");
View Full Code Here


            public void handle(YokeRequest request) {
                request.response().end("hello");
            }
        });

        MultiMap headers = new CaseInsensitiveMultiMap();
        headers.add("x-forwarded-proto", "https");

        new YokeTester(app).request("GET", "/", headers, new Handler<Response>() {
            @Override
            public void handle(Response response) {
                assertEquals(response.headers().get("Strict-Transport-Security"), "max-age=1234; includeSubdomains");
View Full Code Here

            public void handle(YokeRequest request) {
                request.response().end("hello");
            }
        });

        MultiMap headers = new CaseInsensitiveMultiMap();
        headers.add("User-Agent", FIREFOX_23);

        new YokeTester(app).request("GET", "/", headers, new Handler<Response>() {
            @Override
            public void handle(Response response) {
                assertEquals(response.headers().get("X-XSS-Protection"), "1; mode=block");
View Full Code Here

            public void handle(YokeRequest request) {
                request.response().end("hello");
            }
        });

        MultiMap headers = new CaseInsensitiveMultiMap();
        headers.add("User-Agent", IE_9);

        new YokeTester(app).request("GET", "/", headers, new Handler<Response>() {
            @Override
            public void handle(Response response) {
                assertEquals(response.headers().get("X-XSS-Protection"), "1; mode=block");
View Full Code Here

            public void handle(YokeRequest request) {
                request.response().end("hello");
            }
        });

        MultiMap headers = new CaseInsensitiveMultiMap();
        headers.add("User-Agent", IE_8);

        new YokeTester(app).request("GET", "/", headers, new Handler<Response>() {
            @Override
            public void handle(Response response) {
                assertEquals(response.headers().get("X-XSS-Protection"), "0");
View Full Code Here

            public void handle(YokeRequest request) {
                request.response().end("hello");
            }
        });

        MultiMap headers = new CaseInsensitiveMultiMap();
        headers.add("User-Agent", IE_7);

        new YokeTester(app).request("GET", "/", headers, new Handler<Response>() {
            @Override
            public void handle(Response response) {
                assertEquals(response.headers().get("X-XSS-Protection"), "0");
View Full Code Here

            public void handle(YokeRequest request) {
                request.response().end("hello");
            }
        });

        MultiMap headers = new CaseInsensitiveMultiMap();
        headers.add("User-Agent", IE_8);

        new YokeTester(app).request("GET", "/", headers, new Handler<Response>() {
            @Override
            public void handle(Response response) {
                assertEquals(response.headers().get("X-XSS-Protection"), "1; mode=block");
View Full Code Here

    private static MultiMap toMultiMap(Map<String, Object> headers) {
        if (headers == null) {
            return null;
        }

        MultiMap multiMap = new CaseInsensitiveMultiMap();

        for (Map.Entry<String, Object> entry : headers.entrySet()) {
            Object o = entry.getValue();
            if (o != null) {
                if (o instanceof List) {
                    List<String> entries = new ArrayList<>();
                    for (Object v : (List) o) {
                        if (v != null) {
                            entries.add(v.toString());
                        }
                    }
                    multiMap.add(entry.getKey(), entries);
                    continue;
                }
                if (o instanceof String) {
                    multiMap.add(entry.getKey(), (String) o);
                }
            }
        }

        return multiMap;
View Full Code Here

                testComplete();
            }
        });

        // make a new request to / with cookie should return again the same cookie
        MultiMap headers = new CaseInsensitiveMultiMap();
        headers.add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");

        new YokeTester(yoke).request("GET", "/", headers, null);
    }
View Full Code Here

      public void handle(@NotNull YokeRequest request, @NotNull Handler<Object> next) {
        request.response().end(new JsonObject().putString("hello", "world"));
      }
    });

    MultiMap headers = new CaseInsensitiveMultiMap();
    headers.add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
    headers.add("Accept-Encoding", "gzip,deflate,sdch");

      new YokeTester(yoke).request("GET", "/", headers, new Handler<Response>() {
          @Override
          public void handle(Response resp) {
              assertEquals(200, resp.getStatusCode());
View Full Code Here

TOP

Related Classes of org.vertx.java.core.http.CaseInsensitiveMultiMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.