Package com.subgraph.vega.api.http.requests

Examples of com.subgraph.vega.api.http.requests.IPageFingerprint


    injectionChecks.launchInjectionModules(ps);
  }

  private void testResponse(HttpUriRequest request, IHttpResponse response, IInjectionModuleContext ctx) {
    final IPageFingerprint fp = response.getPageFingerprint();
    final IPathState ps = ctx.getPathState();
    if(!ps.matchesPathFingerprint(fp)) {
      ps.setResponseVaries();
      ctx.debug("Response varies");
    }
View Full Code Here


    }
   
    ctx.addRequestResponse(ctx.getCurrentIndex(), request, response);
    if(ctx.incrementResponseCount() < 2)
      return;
    final IPageFingerprint pathFP = ctx.getPathState().getPathFingerprint();
   
    if(ctx.isFingerprintMatch(0, pathFP) && ! ctx.isFingerprintMatch(1, pathFP)) {
      System.out.println("Problem: response to [0]['name']=... identical to name=...");     
    }
  }
View Full Code Here

      scheduleProbes(ctx);
    }
  }

  private void processResponseFingerprint(IInjectionModuleContext ctx, HttpUriRequest req, IHttpResponse res, boolean isFirstResponse) {
    final IPageFingerprint fp = res.getPageFingerprint();
    final IPathState ps = ctx.getPathState();

    if(isFirstResponse && !ps.isSureDirectory() && !ps.isRootPath() && ps.matchesPathFingerprint(fp)) {
      ctx.debug("First 404 probe identical to parent page");
      return;
View Full Code Here

    if(response.isFetchFail()) {
      ctx.error(request, response, "during initial resource fetch");
      return;
    }
    ps.getPath().setVisited(true);
    final IPageFingerprint fp = response.getPageFingerprint();
    final IPathState par = ps.get404Parent();
    final int rcode = response.getResponseCode();
    if((par == null && rcode == 404) || (ps.hasParent404Fingerprint(fp))) {
      ps.setPageMissing();
      ps.unlockChildren();
      ctx.debug("Starting parametric checks on unknown path because page is missing.");
      parametricChecks.initialize(ps);
      return;
    }

    if(par != null && !response.getBodyAsString().isEmpty() && rcode == 200 && fp.isSame(par.getUnknownFingerprint())) {
      ctx.debug("Unknown path fetch matches parent unknown fp, processing as a file.");
      ps.getPath().setPathType(PathType.PATH_FILE);
      fetchFileProcessor.processResponse(null, request, response, ctx);
      return;
    }

    if(par != null && rcode >= 300 && rcode < 400 && fp.isSame(par.getUnknownFingerprint()) && fp.isSame(par.getPathFingerprint())) {
      ctx.debug("Unknown path fetch matches both parent probes, processing as file.");
      ps.getPath().setPathType(PathType.PATH_FILE);
      fetchFileProcessor.processResponse(null, request, response, ctx);
      return;
    }
View Full Code Here

  }

  private boolean isProbe404(IPathState ps, IHttpResponse response) {
    final IPathState p404 = ps.get404Parent();
    final int rcode = response.getResponseCode();
    final IPageFingerprint rfp = response.getPageFingerprint();
    if(p404 != null)
      return p404.has404FingerprintMatching(rfp);
    else
      return rcode == 404;
  }
View Full Code Here

    return contextState.getSavedFingerprint(index);
  }

  @Override
  public boolean isFingerprintMatch(int idx1, int idx2) {
    final IPageFingerprint fp1 = getSavedFingerprint(idx1);
    final IPageFingerprint fp2 = getSavedFingerprint(idx2);
    if (fp1 == null || fp2 == null)
      return false;
    return fp1.isSame(fp2);
  }
View Full Code Here

    return fp1.isSame(fp2);
  }

  @Override
  public boolean isFingerprintMatch(int idx, IPageFingerprint fp) {
    final IPageFingerprint fp2 = getSavedFingerprint(idx);
    if (fp == null || fp2 == null)
      return false;
    return fp.isSame(fp2);
  }
View Full Code Here

      maybeScheduleNext(ctx);
      return;
    }


    final IPageFingerprint pathFP = ctx.getPathState().getPathFingerprint();
    if(pathFP != null && pathFP.isSame(response.getPageFingerprint())) {
      ctx.getPathState().setBogusParameter();
      maybeScheduleNext(ctx);
      return;
    }
View Full Code Here

    final IPathState ps = ctx.getPathState();
    if(response.isFetchFail()) {
      ctx.error(request, response, "during PUT checks");
    } else {
      final int rc = response.getResponseCode();
      final IPageFingerprint fp = response.getPageFingerprint();
     
      if(rc >= 200 && rc < 300 && !ps.matchesPathFingerprint(fp) && !ps.has404FingerprintMatching(fp)) {
        final String resource = request.getURI().toString();
        final String key = "vinfo-http-put:" + resource;
        ctx.publishAlert("vinfo-http-put", key, "HTTP PUT succeeded", request, response, "resource", resource);
View Full Code Here

TOP

Related Classes of com.subgraph.vega.api.http.requests.IPageFingerprint

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.