Skip to content

Commit 3731f7c

Browse files
committed
Split extension at first . when looking for an extension,
prevents us from considering .txt.pdf a PDF for the purpose of RFCs. Fixes ietf-tools#807. - Legacy-Id: 4082
1 parent 0608d52 commit 3731f7c

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

ietf/doc/proxy.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,13 @@ def get_file_type_matches_from(self, glob_path):
6060
possible_types = [".txt", ".pdf", ".xml", ".ps"]
6161
res = []
6262
for m in glob.glob(glob_path):
63+
i = m.find(".")
64+
if i == -1:
65+
ext = ""
66+
else:
67+
ext = m[i:]
6368
for t in possible_types:
64-
if m.endswith(t):
69+
if t == ext:
6570
res.append(t)
6671
return ",".join(res)
6772
#file_type = models.CharField(max_length=20)

0 commit comments

Comments
 (0)