Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit c7963cc7d8787834eac6c844c03238c08b37c825 1 parent 687518b
authored March 09, 2009
9  app.yaml
@@ -6,9 +6,12 @@ api_version: 1
6 6
 handlers:
7 7
 - url: /
8 8
   script: main.py
9  
-- url: /(.*\.(gif|png|jpg|ico))
10  
-  static_files: static/\1
11  
-  upload: static/(.*\.(gif|png|jpg|ico))
  9
+- url: /favicon.ico
  10
+  static_files: static/favicon.ico
  11
+  upload: static/favicon.ico
  12
+- url: /robots.txt
  13
+  static_files: static/robots.txt
  14
+  upload: static/robots.txt
12 15
 - url: /static
13 16
   static_dir: static
14 17
 - url: /.*
4  bin.py
@@ -6,6 +6,8 @@
6 6
 
7 7
 class BinHandler(webapp.RequestHandler):
8 8
     def get(self):
  9
+        if self.request.path[-1] == '/':
  10
+            self.redirect(self.request.path[:-1])
9 11
         bin = self._get_bin()
10 12
         posts = bin.post_set.order('-created').fetch(50)
11 13
         request = self.request
@@ -22,7 +24,7 @@ def post(self):
22 24
         self.redirect('/%s' % bin.name)
23 25
         
24 26
     def _get_bin(self):
25  
-        name = self.request.path[1:]
  27
+        name = self.request.path.replace('/', '')
26 28
         bin = Bin.all().filter('name =', name).get()
27 29
         if bin:
28 30
             return bin
BIN  static/favicon.ico
Binary file not shown
2  static/robots.txt
... ...
@@ -0,0 +1,2 @@
  1
+User-agent: *
  2
+Allow: /

0 notes on commit c7963cc

Please sign in to comment.
Something went wrong with that request. Please try again.