/** * Returns true if a header with the specified name has been added * * @param name the header name * @return true if a header has been added with that name otherwise false */ public boolean containsHeader(String name) { return this.headers.containsEntry(name); }
/** * Returns true if a header with the specified name has been added * * @param name the header name * @param value the header value * @return true if a header has been added with that name otherwise false */ public boolean containsHeader(String name, String value) { return this.headers.containsEntry(name, value); }
/** * Returns true if a header with the specified name has been added * * @param name the Header name * @return true if a header has been added with that name otherwise false */ public boolean containsHeader(String name) { return this.headers.containsEntry(name); }
public static boolean isPreflightRequest(HttpRequest request) { final Headers headers = request.getHeaders(); return request.getMethod().getValue().equals(OPTIONS.name()) && headers.containsEntry(HttpHeaderNames.ORIGIN.toString()) && headers.containsEntry(HttpHeaderNames.ACCESS_CONTROL_REQUEST_METHOD.toString()); }
private void returnNotFound(ResponseWriter responseWriter, HttpRequest request) { HttpResponse response = notFoundResponse(); if (request.getHeaders().containsEntry("x-forwarded-by", "MockServer")) { response.withHeader("x-forwarded-by", "MockServer"); mockServerLogger.trace(request, "no expectation for:{}returning response:{}", request, notFoundResponse()); } else { httpStateHandler.log(new RequestLogEntry(request)); mockServerLogger.info(EXPECTATION_NOT_MATCHED, request, "no expectation for:{}returning response:{}", request, notFoundResponse()); } responseWriter.writeResponse(request, response, false); } }
public void processAction(final HttpRequest request, final ResponseWriter responseWriter, final ChannelHandlerContext ctx, Set<String> localAddresses, boolean proxyThisRequest, final boolean synchronous) { final Expectation expectation = httpStateHandler.firstMatchingExpectation(request); if (request.getHeaders().containsEntry("x-forwarded-by", "MockServer")) {
/** * Returns true if a header with the specified name has been added * * @param name the header name * @return true if a header has been added with that name otherwise false */ public boolean containsHeader(String name) { return this.headers.containsEntry(name); }
/** * Returns true if a header with the specified name has been added * * @param name the Header name * @return true if a header has been added with that name otherwise false */ public boolean containsHeader(String name) { return this.headers.containsEntry(name); }
/** * Returns true if a header with the specified name has been added * * @param name the header name * @param value the header value * @return true if a header has been added with that name otherwise false */ public boolean containsHeader(String name, String value) { return this.headers.containsEntry(name, value); }
public static boolean isPreflightRequest(HttpRequest request) { final Headers headers = request.getHeaders(); return request.getMethod().getValue().equals(OPTIONS.name()) && headers.containsEntry(HttpHeaderNames.ORIGIN.toString()) && headers.containsEntry(HttpHeaderNames.ACCESS_CONTROL_REQUEST_METHOD.toString()); }
private void returnNotFound(ResponseWriter responseWriter, HttpRequest request) { HttpResponse response = notFoundResponse(); if (request.getHeaders().containsEntry("x-forwarded-by", "MockServer")) { response.withHeader("x-forwarded-by", "MockServer"); } else { httpStateHandler.log(new RequestLogEntry(request)); mockServerLogger.info(EXPECTATION_NOT_MATCHED, request, "no expectation for:{}returning response:{}", request, notFoundResponse()); } responseWriter.writeResponse(request, response, false); } }
public void processAction(final HttpRequest request, final ResponseWriter responseWriter, final ChannelHandlerContext ctx, Set<String> localAddresses, boolean proxyThisRequest, final boolean synchronous) { final Expectation expectation = httpStateHandler.firstMatchingExpectation(request); if (request.getHeaders().containsEntry("x-forwarded-by", "MockServer")) {