ripple-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nikolay Khodov (JIRA)" <j...@apache.org>
Subject [jira] [Created] (RIPPLE-53) Proxy for remote debugging hangs if a remote server responds with 304
Date Mon, 17 Feb 2014 09:52:19 GMT
Nikolay Khodov created RIPPLE-53:
------------------------------------

             Summary: Proxy for remote debugging hangs if a remote server responds with 304
                 Key: RIPPLE-53
                 URL: https://issues.apache.org/jira/browse/RIPPLE-53
             Project: Apache Ripple
          Issue Type: Bug
            Reporter: Nikolay Khodov
            Priority: Critical


The proxy hangs if it has to inject code and gets 304 (Not Modifed) response code.

https://github.com/apache/incubator-ripple/blob/a5287cc8f6345d776c00ae26268540c3c0683bc8/lib/server/emulate/hosted.js#L84:

        proxyReq = request(proxyReqData, function (error, response, body) {
            if (error) {
                console.log("ERROR:".red + " Remote proxying failed with:", error);
                res.send(500, error);
            } else if (shouldInjectInto) {
                if (body) { // <--- !!! if response.code === 304, no body --> request
hangs
                    // pretty sure this callback can be called multiple times (not just when
complete)
                    body = body.replace(HEAD_TAG,
                              '<head>' +
                                '<script>' +
                                    BOOTSTRAP_FROM_IFRAME +
                                '</script>');

                    // TODO: Why only need to set new content-length here (and not for localInjection)?
                    response.headers['content-length'] = body.length;

                    res.status(response.statusCode);
                    res.set(response.headers);
                    res.send(body);
                }
            }



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message