Skip to content
This repository was archived by the owner on Jun 14, 2022. It is now read-only.

Commit 71855d5

Browse files
authored
Merge pull request #12 from erik/posix-path
Use `posixpath` instead of `os.path`
2 parents 32256d3 + 7839199 commit 71855d5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

alexandra/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import base64
44
import logging
5-
import os.path
5+
import posixpath
66

77
try:
88
from urlparse import urlparse
@@ -159,7 +159,7 @@ def _get_certificate(cert_url):
159159

160160
url = urlparse(cert_url)
161161
host = url.netloc.lower()
162-
path = os.path.normpath(url.path)
162+
path = posixpath.normpath(url.path)
163163

164164
# Sanity check location so we don't get some random person's cert.
165165
if url.scheme != 'https' or \

tests/test_util.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ def test_bogus_urls(self):
151151
'https://s3.amazonaws.com/EcHo.aPi/echo-api-cert.pem',
152152
'https://s3.amazonaws.com/invalid.path/echo-api-cert.pem',
153153
'https://s3.amazonaws.com:563/echo.api/echo-api-cert.pem',
154+
'https://s3.amazonaws.com:443/echo.api/../echo-api-cert.pem',
154155
]
155156

156157
for case in cases:

0 commit comments

Comments
 (0)