Fix broken redirect (#467)

By default, flask turns redirects into absolute URLs. This is
undesired behaviour on Kubernetes, because the Pod's own IP address is
not really useful to any client that's not in the cluster (and even
within the cluster most clients will want to use the address of a
Service, not a Pod).
This commit is contained in:
Soam Vasani
2018-01-30 12:00:30 -08:00
committed by GitHub
parent eccbc58190
commit 0cb13dc20d
+3 -1
View File
@@ -13,4 +13,6 @@ def main():
# back to the list
item = request.form['text']
redisConnection.rpush('guestbook', item)
return redirect('/guestbook', code=303)
r = redirect('/guestbook', code=303)
r.autocorrect_location_header = False
return r