[Twisted-Python] Basic HTTP Authentication in Twisted.web

Thomas Weholt 2002 at weholt.org
Tue Feb 18 18:07:05 EST 2003

Thanks for the tip.

Changed the code to use the same content for both the body and the
Content-Length-header. Still no go. Isn't there a special Twisted way of
doing this? My curreny solution is as I said earlier a dirty hack based on
code from BaseHTTPServer.

Anybody else has this kind of authentication going in their application who
can spare a few lines of code as an example ???


----- Original Message -----
From: "Jeff Epler" <jepler at unpythonic.net>
To: <twisted-python at twistedmatrix.com>
Sent: Tuesday, February 18, 2003 11:00 PM
Subject: Re: [Twisted-Python] Basic HTTP Authentication in Twisted.web

> On Tue, Feb 18, 2003 at 09:11:03PM +0100, Thomas Weholt wrote:
> >             request.setHeader('Content-Length', str(len('401:
Authorization needed.')))
> ...
> >             return '<h1>401 Authentication required</h1>%s' % msg
> Your Content-Length and actual body are different.  This may be the
> point at which all hell breaks loose.
> Jeff
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

More information about the Twisted-Python mailing list