Class AntiCache

java.lang.Object
org.microproxy.extras.AntiCache
All Implemented Interfaces:
HttpFiltersSource

public final class AntiCache extends Object implements HttpFiltersSource
Removes the request headers that let a server answer 304 Not Modified ( If-None-Match and If-Modified-Since), as mitmproxy's anticache, so that clients get whole responses, which other addons and recorders can then see. Reads heads only.

 bootstrap.plusFiltersSource(AntiCache.create());
 
  • Method Details

    • create

      public static AntiCache create()
      Strips the conditional headers from every request.
      Returns:
      the addon
    • matching

      public static AntiCache matching(FlowFilter filter)
      Strips the conditional headers from the requests filter matches (body matchers do not match: the body is never buffered for this).
      Parameters:
      filter - the requests to change
      Returns:
      the addon
    • filterRequest

      public HttpFilters filterRequest(HttpRequest originalRequest, FlowContext flowContext)
      Description copied from interface: HttpFiltersSource
      Returns the filters for a request, or null to proxy it unfiltered.
      Specified by:
      filterRequest in interface HttpFiltersSource
      Parameters:
      originalRequest - a copy of the request as received from the client
      flowContext - the client connection the request arrived on
      Returns:
      the per-request filters, or null to leave the request unfiltered