Skip to content

Commit

Permalink
Merge pull request #4801 from rtfd/allow-local-files-in-dev
Browse files Browse the repository at this point in the history
Allow use of `file://` urls in repos during development.
  • Loading branch information
ericholscher authored Nov 1, 2018
2 parents 28773ee + 212b3f3 commit 7202e08
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ exclude_lines =
pragma: no cover
raise NotImplementedError
if __name__ == .__main__.:
if getattr(settings, 'DEBUG'):
3 changes: 3 additions & 0 deletions readthedocs/projects/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,12 @@ def __call__(self, value):
allow_private_repos = getattr(settings, 'ALLOW_PRIVATE_REPOS', False)
public_schemes = ['https', 'http', 'git', 'ftps', 'ftp']
private_schemes = ['ssh', 'ssh+git']
local_schemes = ['file']
valid_schemes = public_schemes
if allow_private_repos:
valid_schemes += private_schemes
if getattr(settings, 'DEBUG'): # allow `file://` urls in dev
valid_schemes += local_schemes
url = urlparse(value)

# Malicious characters go first
Expand Down

0 comments on commit 7202e08

Please sign in to comment.