projects
/
geekigeeki.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add .webm video extension support
[geekigeeki.git]
/
geekigeeki.py
diff --git
a/geekigeeki.py
b/geekigeeki.py
index 0427f9b3a4f40e538a256bede1ffb7cb4e7b47b5..e15db21cf57a601071b208df64449f50ca1e2825 100755
(executable)
--- a/
geekigeeki.py
+++ b/
geekigeeki.py
@@
-21,7
+21,7
@@
title_done = False
import cgi, sys, os, re, errno, stat, glob
image_ext = 'png|gif|jpg|jpeg|bmp|ico'
import cgi, sys, os, re, errno, stat, glob
image_ext = 'png|gif|jpg|jpeg|bmp|ico'
-video_ext = "ogg|ogv|oga
" # Not supported by Firefox 3.5
: mkv|mpg|mpeg|mp4|avi|asf|flv|wmv|qt
+video_ext = "ogg|ogv|oga
|webm" # Not supported by Firefox 3.6
: mkv|mpg|mpeg|mp4|avi|asf|flv|wmv|qt
image_re = re.compile(r".*\.(" + image_ext + "|" + video_ext + ")$", re.IGNORECASE)
video_re = re.compile(r".*\.(" + video_ext + ")$", re.IGNORECASE)
# FIXME: we accept stuff like foo/../bar and we shouldn't
image_re = re.compile(r".*\.(" + image_ext + "|" + video_ext + ")$", re.IGNORECASE)
video_re = re.compile(r".*\.(" + video_ext + ")$", re.IGNORECASE)
# FIXME: we accept stuff like foo/../bar and we shouldn't
@@
-107,6
+107,8
@@
def url_args(kvargs):
def emit_header(mtime=None, mime_type="text/html"):
if mtime:
def emit_header(mtime=None, mime_type="text/html"):
if mtime:
+ # Prevent caching when the wiki engine gets updated
+ mtime = max(mtime, os.stat(__file__).st_mtime)
print("Last-Modified: " + strftime("%a, %d %b %Y %H:%M:%S GMT", gmtime(mtime)))
if mime_type:
print("Content-type: " + mime_type + "; charset=utf-8")
print("Last-Modified: " + strftime("%a, %d %b %Y %H:%M:%S GMT", gmtime(mtime)))
if mime_type:
print("Content-type: " + mime_type + "; charset=utf-8")