Hi Douglas,

On Sun, 2007-06-10 at 21:32 -0700, DouglasPhillips wrote:
> I've got a really strange problem here.  I've tried and tried to work
> it out, and have gotten nowhere.
> 
> I copied a customer's site as-is to a new server for development.
> Everything works as expected on the existing (production) server.
> 
> On the new development server, the site works as expected under IE,
> but under Firefox, I get a "The connection to (ip) was interrupted
> while the page was loading".  Using various http sniffers, it appears
> that there is no proper status code being returned.

In all cases? Or just to Firefox?

> 
> The operation of the page is such that http requests are redirected to
> SSL using the SSLMiddleware module.
> 
> Django 0.95, Firefox 2.0.0.1
> 
> Relevant code in the views is:
> 
>     h = HttpResponse(start + s3 + end)
>     h["Content-Type"] = "text/html"
> 
>     return h
> 
> where start, s3, and end are rendered html pages.
> 
> I'm at my wits' end, and I'm not familiar enough with django (although
> I'm pretty fluent in python) to know where to start looking.

That looks like it should be working and if it wasn't, you'd be able to
hear the screams from thousands of Django users around the world. So
something strange is going on.

To help you work out where to poke around for debugging purposes, a few
hints: The HttpResponse class has a status_code attribute that is set to
200 by default, so you don't need to do anything special there.

The actual construction of the response happens in django/core/handlers.
You don't mention which serving environment you are using (development
server, but you can find where both modpython.py and wsgi.py are setting
the status_code for the return. You could check that the right values
are being set at that point, for a start.

Note that by the time the status code is set in the HTTP response in
those two modules, any response middleware has already been run. When
you say you are using the SSL Middleware, I guess you mean this one:
http://www.djangosnippets.org/snippets/85/ ? Never used it myself, but
from a quick read-through, there doesn't look to be anything wrong
there.

You might also need to look at pieces of your installation downstream
from Django. Are you using flup or something like that to hook up to the
webserver? Or mod_python? Is there anything else there that could be
working on the response before you see it on the network wire?

I can't think of any way that Django would be sending out a reply
without the status code unless there is some really silly decorator or
middleware in the stack that is intentionally removing it. Grep for
status_code amongst all your third-party pieces to look for gremlins,
just in case. It does sound odd, though.

Regards,
Malcolm


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to