Permalink
Browse files

hiding test form and making posts only redirect in browsers

  • Loading branch information...
1 parent 84e2bb6 commit 59184d2f7bec3d71399e799e59a9da47554c3e46 @progrium progrium committed Sep 6, 2009
Showing with 4 additions and 3 deletions.
  1. +2 −1 bin.py
  2. +2 −2 templates/bin.html
View
@@ -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
@@ -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 %}

0 comments on commit 59184d2

Please sign in to comment.