chiark
/
gitweb
/
~tthurman
/
dwim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4187c3c
)
fake-dw --ersatz honours the --host param in its Set-Cookie header
author
Marnanel Thurman
<marnanel@thurman.org.uk>
Sun, 19 Dec 2021 09:00:06 +0000
(09:00 +0000)
committer
Marnanel Thurman
<marnanel@thurman.org.uk>
Sun, 19 Dec 2021 09:00:32 +0000
(09:00 +0000)
fake-dw/fake-dw.py
patch
|
blob
|
history
diff --git
a/fake-dw/fake-dw.py
b/fake-dw/fake-dw.py
index 053152aceafd3cad4ffc4c024dc3a58255f6da21..6b574a844da0baa50dda351d19e3cf416a35f10d 100644
(file)
--- a/
fake-dw/fake-dw.py
+++ b/
fake-dw/fake-dw.py
@@
-162,7
+162,10
@@
class ErsatzHandler(http.server.BaseHTTPRequestHandler):
session = hex(random.randint(0, 65535))
self.server.session_id = session
fields['template-name']= 'login'
- fields['set-cookie'] = f"ljuniq={session}; domain=localhost; path=/; expires=Sun, 23-Jan-2200 19:18:56 GMT"
+ fields['set-cookie'] = f"ljuniq={session}; "+\
+ f"domain={self.server.settings.host}; path=/; "+\
+ f"expires=Sun, 23-Jan-2200 19:18:56 GMT"
+
fields['session'] = session
self.server.lj_form_auth = LJ_FORM_AUTH_FORMAT % fields