Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

hiding test form and making posts only redirect in browsers

  • Loading branch information...
commit 59184d2f7bec3d71399e799e59a9da47554c3e46 1 parent 84e2bb6
@progrium progrium authored
Showing with 4 additions and 3 deletions.
  1. +2 −1  bin.py
  2. +2 −2 templates/bin.html
View
3  bin.py
@@ -31,7 +31,7 @@ def post(self):
if 'http://' in self.request.query_string:
urlfetch.fetch(url=self.request.query_string.replace('http://', 'http://hookah.webhooks.org/'),
payload=urllib.urlencode(self.request.POST.items()), method='POST')
- self.redirect('/%s' % bin.name)
+ self.response.out.write('<html><head><meta http-equiv="refresh" content="0;url=/%s" /></head><body>OK</body></html>' % bin.name)
def head(self):
bin = self._get_bin(self.request.path)
@@ -71,5 +71,6 @@ def _get_bin(self, path):
self.redirect('/')
+
if __name__ == '__main__':
wsgiref.handlers.CGIHandler().run(webapp.WSGIApplication([('/.*', BinHandler)], debug=True))
View
4 templates/bin.html
@@ -33,11 +33,11 @@
</li>
{% endfor %}
</ul>
- <form action="?test" method="post">
+ <!--form action="?test" method="post">
<input type="hidden" name="foo" value="bar" />
<input type="hidden" name="bar" value="baz" />
<input type="hidden" name="bar" value="baz two" />
<input type="submit" value="Test Post" />
- </form>
+ </form-->
<a href="/">Back Home</a>
{% endblock %}
Please sign in to comment.
Something went wrong with that request. Please try again.