Skip to content
Browse files

?defaulticon=1pxgif option

git-svn-id: https://potato.codebasehq.com/getfavicon/getfavicon.svn/trunk@27 0c1c7bd3-9391-4859-b94e-4e2dcdc6a516
  • Loading branch information...
1 parent 735f1b3 commit af6983141eec1ab9aeedb0bf653cc701bbbe7f8f jason committed Aug 30, 2010
Showing with 5 additions and 1 deletion.
  1. BIN 1px.gif
  2. +4 −0 main.py
  3. +1 −1 templates/index.html
View
BIN 1px.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
4 main.py
@@ -375,6 +375,10 @@ def writeDefault(self, fromCache = False):
if self.request.get("defaulticon") == "none":
self.response.set_status(204)
+
+ elif self.request.get("defaulticon") == "1pxgif":
+
+ self.response.out.write(open("1px.gif").read())
else:
View
2 templates/index.html
@@ -20,7 +20,7 @@
<h3>Default icon</h3>
<p>You can specify a default icon to be displayed should the favicon not be found...</p>
<pre>http://getfavicon.appspot.com/http://www.google.com?defaulticon=http://en.wikipedia.org/favicon.ico</pre>
- <p>If you pass <code>?defaulticon=none</code> then no default icon will be returned (and an HTTP 204 "No content" response code).</p>
+ <p>If you pass <code>?defaulticon=none</code> then no default icon will be returned (and an HTTP 204 "No content" response code), <code>?defaulticon=1pxgif</code> will return a 200 response and a 1x1 pixel GIF file.</p>
<h3>Multiple domains</h3>
<p>To improve the performance of pages with many favicons on them you can overcome <a href="http://www.stevesouders.com/blog/2008/03/20/roundup-on-parallel-connections/">browser connection limits</a> by pointing to the icon on different domains. You can see this in action on the <a href="/test/">test page</a> where we use the first letter of the domain to generate a subdomain name. The domains are of the format...</p>

0 comments on commit af69831

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