forked from github.com/pypiserver
Default fallback_url to use HTTPS
`pypi.python.org/simple` will respond to HTTP requests with `403: SSL is required.` This will change the default fallback_url to use HTTPS. This should fix #179.
This commit is contained in:
parent
d62d81309b
commit
519c195253
@ -68,7 +68,7 @@ def configure(**kwds):
|
||||
"Could not load welcome-file(%s)!", c.welcome_file, exc_info=1)
|
||||
|
||||
if c.fallback_url is None:
|
||||
c.fallback_url = "http://pypi.python.org/simple"
|
||||
c.fallback_url = "https://pypi.python.org/simple"
|
||||
|
||||
if c.hash_algo:
|
||||
try:
|
||||
|
@ -178,7 +178,7 @@ def test_fallback(root, _app, testapp):
|
||||
assert _app.config.redirect_to_fallback
|
||||
resp = testapp.get("/simple/pypiserver/", status=302)
|
||||
assert resp.headers[
|
||||
"Location"] == "http://pypi.python.org/simple/pypiserver/"
|
||||
"Location"] == "https://pypi.python.org/simple/pypiserver/"
|
||||
|
||||
|
||||
def test_no_fallback(root, _app, testapp):
|
||||
|
@ -80,14 +80,14 @@ def test_root_r(main):
|
||||
|
||||
|
||||
def test_fallback_url(main):
|
||||
main(["--fallback-url", "http://pypi.mirror/simple"])
|
||||
assert main.app.module.config.fallback_url == "http://pypi.mirror/simple"
|
||||
main(["--fallback-url", "https://pypi.mirror/simple"])
|
||||
assert main.app.module.config.fallback_url == "https://pypi.mirror/simple"
|
||||
|
||||
|
||||
def test_fallback_url_default(main):
|
||||
main([])
|
||||
assert main.app.module.config.fallback_url == \
|
||||
"http://pypi.python.org/simple"
|
||||
"https://pypi.python.org/simple"
|
||||
|
||||
|
||||
def test_hash_algo_default(main):
|
||||
|
Loading…
Reference in New Issue
Block a user