Skip to content

Commit

Permalink
Fix small httpproxy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jayjb committed Sep 15, 2021
1 parent c85d092 commit c46505e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions opencanary/modules/httpproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ def logAuth(self):
factory = AlertProxyRequest.FACTORY

username, password = "Invalid auth-token submitted", ""
atype, token = auth.split(" ")
auth_arr = auth.split(" ")
if len(auth_arr) != 2:
return

atype, token = auth_arr
if atype == "Basic":
try:
username, password = b64decode(token).split(":")
Expand All @@ -99,7 +103,7 @@ def process(self):
factory = AlertProxyRequest.FACTORY
profile = PROFILES[factory.skin]
content = factory.auth_template.render(
url=self.uri,
url=self.uri.decode(),
date=datetime.datetime.utcnow().strftime("%a, %d %b %Y %H:%M:%S %ZGMT"),
clientip=self.transport.getPeer().host
)
Expand Down

0 comments on commit c46505e

Please sign in to comment.