Package org.owasp.webscarab.model

Examples of org.owasp.webscarab.model.HttpUrl


        List attributes = new LinkedList();
        Request request = this.model.getRequest(id);
        String method = request.getMethod();
        NamedValue[] values = null;
        if ("GET".equals(method)) {
            HttpUrl url = request.getURL();
            String query = url.getQuery();
            if (null != query) {
                values = NamedValue.splitNamedValues(query, "&", "=");
            }
        } else if ("POST".equals(method)) {
            byte[] requestContent = request.getContent();
View Full Code Here


        List attributes = new LinkedList();
        Request request = this.model.getRequest(id);
        String method = request.getMethod();
        NamedValue[] values = null;
        if ("GET".equals(method)) {
            HttpUrl url = request.getURL();
            String query = url.getQuery();
            if (null != query) {
                values = NamedValue.splitNamedValues(query, "&", "=");
            }
        } else if ("POST".equals(method)) {
            byte[] requestContent = request.getContent();
View Full Code Here

    public PAPEResponse getPAPEResponse(ConversationID id) {
        Request request = this.model.getRequest(id);
        String method = request.getMethod();
        NamedValue[] values = null;
        if ("GET".equals(method)) {
            HttpUrl url = request.getURL();
            String query = url.getQuery();
            if (null != query) {
                values = NamedValue.splitNamedValues(query, "&", "=");
            }
        } else if ("POST".equals(method)) {
            byte[] requestContent = request.getContent();
View Full Code Here

        NamedValue[] values = null;

        Request request = this.model.getRequest(id);
        String method = request.getMethod();
        if (method.equals("GET")) {
            HttpUrl url = request.getURL();
            String query = url.getQuery();
            if (null != query) {
                values = NamedValue.splitNamedValues(query, "&", "=");
            }
        } else if (method.equals("POST")) {
            byte[] requestContent = request.getContent();
View Full Code Here

            dhSession = null;
        }
        AssociationRequest associationRequest = AssociationRequest.createAssociationRequest(associationSessionType, dhSession);
        Request request = new Request();
        request.setMethod("POST");
        request.setURL(new HttpUrl(opUrl));
        request.setHeader("Content-Type", "application/x-www-form-urlencoded");

        StringBuilder body = new StringBuilder();
        Map parameters = associationRequest.getParameterMap();
        Set parameterEntries = parameters.entrySet();
View Full Code Here

        }
        if (links.size() == max) return;
        UrlModel urlModel = _model.getUrlModel();
        int count = urlModel.getChildCount(url);
        for (int i=0; i<count; i++) {
            HttpUrl child = urlModel.getChildAt(url, i);
            queueLinksUnder(child, links, max);
            if (links.size() == max) return;
        }
    }
View Full Code Here

    public String getOPUrl(ConversationID id) {
        if (false == isOpenIDRequestMessage(id)) {
            return null;
        }
        HttpUrl httpUrl = this.model.getRequestUrl(id);
        return httpUrl.getSHPP();
    }
View Full Code Here

    public void clearQueue() {
        _model.clearLinkQueue();
    }
   
    private Request newGetRequest(Link link) {
        HttpUrl url = link.getURL();
        String referer = link.getReferer();
        Request req = new Request();
        req.setMethod("GET");
        req.setURL(url);
        req.setVersion("HTTP/1.0"); // 1.1 or 1.0?
        if (referer != null) {
            req.setHeader("Referer", referer);
        }
        req.setHeader("Host", url.getHost() + ":" + url.getPort());
        if (req.getVersion().equals("HTTP/1.0"))
            req.setHeader("Connection", "Keep-Alive");
        NamedValue[] headers = _model.getExtraHeaders();
        if (headers != null && headers.length > 0) {
            for (int i=0; i< headers.length; i++) {
View Full Code Here

    }
   
    public static Parameter[] getParameters(Request request) {
        List<Parameter> parameters = new ArrayList<Parameter>();
        String method = request.getMethod();
        HttpUrl url = request.getURL();
       
        String query = url.getQuery();
        String fragments = url.getFragment();
        if (url.getParameters() != null) url = url.getParentUrl();
        String contentType = request.getHeader("Content-Type");
       
        if (fragments != null) {
            NamedValue[] values = NamedValue.splitNamedValues(fragments, "&", "=");
            for (int i=0; i<values.length; i++) {
View Full Code Here

    public String getStatus() {
        return _model.getStatus();
    }
   
    public void analyse(ConversationID id, Request request, Response response, String origin) {
        HttpUrl base = request.getURL();
        if (response.getStatus().equals("302")) {
            String location = response.getHeader("Location");
            if (location != null) {
                try {
                    HttpUrl url = new HttpUrl(base, location);
                    _model.addUnseenLink(url, base);
                } catch (MalformedURLException mue) {
                    _logger.warning("Badly formed Location header : " + location);
                }
            } else {
View Full Code Here

TOP

Related Classes of org.owasp.webscarab.model.HttpUrl

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.