Coder Social home page Coder Social logo

inproctester's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

inproctester's Issues

UrlHelper.getRequestPath(URI uri) unescapes paths containing spaces.

When the URI is created with something of the form "http://somehost/path/to/some%20thing", UrlHelper will first unescape it and then construct a URI string from the unescaped path.

One way to prevent this is to fetch a string from a URI using new URI("http://somehost/path/to/some%20thing").toASCIIString().

Interestingly URLEncoder should be avoided for URIs used as locations since it doesn't handle the escaping correctly. it is actually intended for encoding form bodies to be sent using application/x-www-form-urlencoded. See http://stackoverflow.com/questions/4737841/urlencoder-not-able-to-translate-space-character for more details.

still viable ?

Also, what's the way in programaticaly?

driver = new InrocDriver(); ?

Content should be set on request regardless of HTTP method.

In the following, the explicit check for POST as HTTP method prevents content from the request being sent. The HTTP spec. doesn't explicitly disallow content for any method type so no check should be performed.

@Override
public InProcResponse getResponses(InProcRequest request) {
    HttpTester httpTester = new HttpTester();
    httpTester.setMethod(request.getHttpMethod());
    httpTester.setURI(UrlHelper.getRequestPath(request.getUri()));
    for (String headerName : request.getHeaderNames()) {
        httpTester.addHeader(headerName, request.getHeader(headerName));
    }

    if ("POST".equals(request.getHttpMethod())) {
        httpTester.setContent(request.getContent());
    }

    try {
        String rawResponse = getResponses(httpTester.generate());
        HttpTester testerResponse = new HttpTester();
        testerResponse.parse(rawResponse);
        return new JettyInProcResponse(testerResponse);
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.