Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Error after 302 then 304 #7051

Hamdy opened this Issue · 3 comments

3 participants


am having an http action that redirects user to another action when user has met some condition.
the problem is I get frequently get garbage HTML in my browser page like:

        <script type="text/javascript" src="//"></script>
</html>HTTP/1.1 304 Not Modified
ETag: "-485306310"
Date: Wed, 05 Feb 2014 17:32:56 GMT
Connection: keep-alive

This case sometimes happens for me when there's 302 then 304 HTTP responses.

debug: discarding transport
Passport: DeSerialzing User from session 52f254ffa33d553431b2faf6
GET / 302 31ms - 66b
Passport: DeSerialzing User from session 52f254ffa33d553431b2faf6
GET /go 304 27ms

Then I get that garbage HTML in my browser


Hello! May I ask you to provide a test case for us?

@trevnorris trevnorris added the http label

Hello, I don't have a test case for this,
but my use case was the following:

# home ('/')
exports.home = function(req, res){
     if(user is logged in)

 # chat ('/chat') = function(req, res){
     if(user not logged in)
          // every thing is fine

Now The error used to happen more often when connection is slow a bit, and I'm logged in
and my location is "/chat" then trying to go to "/", this error happens
as / will redirect me back to /chat.

We replaced redirect('/chat') with

   res.writeHead(302, { 'Location': '/chat'});

This seems to help in solving the problem, as we can't reproduce it again.


Sorry, could you please provide a complete test case that won't require me to finish it in order to be able to test it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.