On Sep 18, 9:28 pm, Jarek Zgoda <[EMAIL PROTECTED]> wrote:
> Wiadomość napisana w dniu 2008-09-18, o godz. 13:17, przez Graham  
> Dumpleton:
>
>
>
> >>>> If using mod_python, the Apache LimitRequestBody directive doesn't
> >>>> work entirely properly.
> >>> I have heard of a "Content-length" variable (from PHP, but it's an
> >>> http
> >>> thing) -- how could I use that? request["Content-length"] or
> >>> something like
> >>> that.
>
> >> You can use, but you can not rely. Browsers are notorious liars, even
> >> if they provide any data in this header field.
>
> > If Content-Length was an unreliable indicator of request content then
> > web applications wouldn't work properly. The only instance I know of
> > that Content-Length passed in to an application may not be correct is
> > when hosting on Apache and you have an Apache input filter installed
> > which mutates the input such that the amount of content changes.
> > Luckily things like using compression on request content is hardly
> > ever done and so this doesn't become an issue though.
>
> > Now, where on earth have you got this idea that you can not rely on
> > Content-Length on a request?
>
> I saw actual request bodies larger than declared in content-lentgh  
> with Firefox 2, this browser often was lying to my nginx in cases of  
> small bodies by 1-4 bytes.

What sort of application was that? Were the POSTs in the case actually
being generated by AJAX code running in browser?

I would trust Firefox to be doing the correct thing for basic concepts
of HTML form posting and file upload, but I wouldn't be surprised if
server provided AJAX code screwed up if there were generating the
content length themselves.

Another possibility is that people were uploading files that were
still being written to by some application and thus were changing in
length.

Graham
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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