Permalink
Browse files

adding favicon and robots.txt, allowing posting to bin paths ending w…

…ith / and redirecting get requests to a path not ending in /
  • Loading branch information...
1 parent 687518b commit c7963cc7d8787834eac6c844c03238c08b37c825 Jeff Lindsay committed Mar 9, 2009
Showing with 11 additions and 4 deletions.
  1. +6 −3 app.yaml
  2. +3 −1 bin.py
  3. BIN static/favicon.ico
  4. +2 −0 static/robots.txt
View
9 app.yaml
@@ -6,9 +6,12 @@ api_version: 1
handlers:
- url: /
script: main.py
-- url: /(.*\.(gif|png|jpg|ico))
- static_files: static/\1
- upload: static/(.*\.(gif|png|jpg|ico))
+- url: /favicon.ico
+ static_files: static/favicon.ico
+ upload: static/favicon.ico
+- url: /robots.txt
+ static_files: static/robots.txt
+ upload: static/robots.txt
- url: /static
static_dir: static
- url: /.*
View
4 bin.py
@@ -6,6 +6,8 @@
class BinHandler(webapp.RequestHandler):
def get(self):
+ if self.request.path[-1] == '/':
+ self.redirect(self.request.path[:-1])
bin = self._get_bin()
posts = bin.post_set.order('-created').fetch(50)
request = self.request
@@ -22,7 +24,7 @@ def post(self):
self.redirect('/%s' % bin.name)
def _get_bin(self):
- name = self.request.path[1:]
+ name = self.request.path.replace('/', '')
bin = Bin.all().filter('name =', name).get()
if bin:
return bin
View
BIN static/favicon.ico
Binary file not shown.
View
2 static/robots.txt
@@ -0,0 +1,2 @@
+User-agent: *
+Allow: /

0 comments on commit c7963cc

Please sign in to comment.