Merge pull request #194 from mplanchard/180-update-404

Update 404 to match PyPI
This commit is contained in:
Matthew Planchard 2017-12-03 16:22:02 -06:00 committed by GitHub
commit 46ba4ac532
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -259,7 +259,7 @@ def simple(prefix=""):
if not files: if not files:
if config.redirect_to_fallback: if config.redirect_to_fallback:
return redirect("%s/%s/" % (config.fallback_url.rstrip("/"), prefix)) return redirect("%s/%s/" % (config.fallback_url.rstrip("/"), prefix))
return HTTPError(404) return HTTPError(404, 'Not Found (%s does not exist)\n\n' % normalized)
fp = request.fullpath fp = request.fullpath
links = [(os.path.basename(f.relfn), links = [(os.path.basename(f.relfn),
@ -321,7 +321,7 @@ def server_static(filename):
"Cache-Control", "public, max-age=%s" % config.cache_control) "Cache-Control", "public, max-age=%s" % config.cache_control)
return response return response
return HTTPError(404) return HTTPError(404, 'Not Found (%s does not exist)\n\n' % filename)
@app.route('/:prefix') @app.route('/:prefix')