Skip to content

Commit

Permalink
Split extension at first . when looking for an extension,
Browse files Browse the repository at this point in the history
prevents us from considering .txt.pdf a PDF for the purpose of RFCs.
Fixes #807.
 - Legacy-Id: 4082
  • Loading branch information
OleLaursen committed Mar 14, 2012
1 parent 0608d52 commit 3731f7c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ietf/doc/proxy.py
Expand Up @@ -60,8 +60,13 @@ def get_file_type_matches_from(self, glob_path):
possible_types = [".txt", ".pdf", ".xml", ".ps"]
res = []
for m in glob.glob(glob_path):
i = m.find(".")
if i == -1:
ext = ""
else:
ext = m[i:]
for t in possible_types:
if m.endswith(t):
if t == ext:
res.append(t)
return ",".join(res)
#file_type = models.CharField(max_length=20)
Expand Down

0 comments on commit 3731f7c

Please sign in to comment.