From: SourceForge.net <no...@so...> - 2005-10-19 23:29:34
|
Bugs item #1332714, was opened at 2005-10-19 16:29 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112078&aid=1332714&group_id=12078 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: http backend with basic authentication Initial Comment: It seems that apt-proxy in the current sarge stable version does not support http basic authentication for the backends. here is an easy patch that could fix that, in the hope it could help anybody. -Tim K --- apt_proxy.py.orig 2005-10-20 00:41:58.000000000 +0200 +++ apt_proxy.py 2005-10-20 01:20:05.000000000 +0200 @@ -26,6 +26,7 @@ import time import string import packages +import base64 from twisted.python.failure import Failure import memleak from twisted.internet import error @@ -583,9 +584,13 @@ + self.request.backendServer.host + ":" + str(self.request.backendServer.port) + "/" + self.request.backendServer.path + "/" + self.request.backend_uri) - + self.sendHeader('host', self.request.backendServer.host) + # if we have a username send basic authentication to the server + if self.request.backendServer.username: + self.sendHeader('Authorization', 'Basic ' + base64.encodestring (self.request.backendServer.username+':'+self.request.ba ckendServer.password)) + if self.local_mtime != None: datetime = http.datetimeToString (self.local_mtime) self.sendHeader('if-modified-since', datetime) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112078&aid=1332714&group_id=12078 |