We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
pyhf contrib download fails gracelessly with invalid URL
# Description

calling `pyhf contrib download` (just to see what it does) fails pretty violently. hould we make itt a bit nicer @matthewfeickert 
?

```
pyhf contrib download
Traceback (most recent call last):
  File "/Users/lukasheinrich/Code/pyhfdev/dev/pyhfdevenv/bin/pyhf", line 33, in <module>
    sys.exit(load_entry_point('pyhf', 'console_scripts', 'pyhf')())
  File "/Users/lukasheinrich/Code/pyhfdev/dev/pyhfdevenv/lib/python3.7/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/Users/lukasheinrich/Code/pyhfdev/dev/pyhfdevenv/lib/python3.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/Users/lukasheinrich/Code/pyhfdev/dev/pyhfdevenv/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/lukasheinrich/Code/pyhfdev/dev/pyhfdevenv/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/lukasheinrich/Code/pyhfdev/dev/pyhfdevenv/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/lukasheinrich/Code/pyhfdev/dev/pyhfdevenv/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/Users/lukasheinrich/Code/pyhfdev/dev/pyhfsrc/src/pyhf/cli/contrib.py", line 60, in download
    utils.download(archive_url, output_directory, force, compress)
  File "/Users/lukasheinrich/Code/pyhfdev/dev/pyhfsrc/src/pyhf/contrib/utils.py", line 47, in download
    + "To download an archive from this host use the --force option."
pyhf.exceptions.InvalidArchiveHost:  is not an approved archive host: www.hepdata.net, doi.org
To download an archive from this host use the --force option.
```


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `src/pyhf/cli/contrib.py`
Content:
```
1 """CLI for functionality that will get migrated out eventually."""
2 import logging
3 import click
4 from pathlib import Path
5 
6 from ..contrib import utils
7 
8 logging.basicConfig()
9 log = logging.getLogger(__name__)
10 
11 
12 @click.group(name="contrib")
13 def cli():
14     """
15     Contrib experimental operations.
16 
17     .. note::
18 
19         Requires installation of the ``contrib`` extra.
20 
21         .. code-block:: shell
22 
23             $ python -m pip install pyhf[contrib]
24     """
25 
26 
27 @cli.command()
28 @click.argument("archive-url", default="-")
29 @click.argument("output-directory", default="-")
30 @click.option("-v", "--verbose", is_flag=True, help="Enables verbose mode")
31 @click.option(
32     "-f", "--force", is_flag=True, help="Force download from non-approved host"
33 )
34 @click.option(
35     "-c",
36     "--compress",
37     is_flag=True,
38     help="Keep the archive in a compressed tar.gz form",
39 )
40 def download(archive_url, output_directory, verbose, force, compress):
41     """
42     Download the patchset archive from the remote URL and extract it in a
43     directory at the path given.
44 
45     Example:
46 
47     .. code-block:: shell
48 
49         $ pyhf contrib download --verbose https://www.hepdata.net/record/resource/1408476?view=true 1Lbb-likelihoods
50 
51         \b
52         1Lbb-likelihoods/patchset.json
53         1Lbb-likelihoods/README.md
54         1Lbb-likelihoods/BkgOnly.json
55 
56     Raises:
57         :class:`~pyhf.exceptions.InvalidArchiveHost`: if the provided archive host name is not known to be valid
58     """
59     try:
60         utils.download(archive_url, output_directory, force, compress)
61 
62         if verbose:
63             file_list = [str(file) for file in list(Path(output_directory).glob("*"))]
64             print("\n".join(file_list))
65     except AttributeError as excep:
66         exception_info = (
67             str(excep)
68             + "\nInstallation of the contrib extra is required to use the contrib CLI API"
69             + "\nPlease install with: python -m pip install pyhf[contrib]\n"
70         )
71         log.error(exception_info)
72
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/src/pyhf/cli/contrib.py b/src/pyhf/cli/contrib.py
--- a/src/pyhf/cli/contrib.py
+++ b/src/pyhf/cli/contrib.py
@@ -25,8 +25,8 @@
 
 
 @cli.command()
-@click.argument("archive-url", default="-")
-@click.argument("output-directory", default="-")
+@click.argument("archive-url")
+@click.argument("output-directory")
 @click.option("-v", "--verbose", is_flag=True, help="Enables verbose mode")
 @click.option(
     "-f", "--force", is_flag=True, help="Force download from non-approved host"

{"golden_diff": "diff --git a/src/pyhf/cli/contrib.py b/src/pyhf/cli/contrib.py\n--- a/src/pyhf/cli/contrib.py\n+++ b/src/pyhf/cli/contrib.py\n@@ -25,8 +25,8 @@\n \n \n @cli.command()\n-@click.argument(\"archive-url\", default=\"-\")\n-@click.argument(\"output-directory\", default=\"-\")\n+@click.argument(\"archive-url\")\n+@click.argument(\"output-directory\")\n @click.option(\"-v\", \"--verbose\", is_flag=True, help=\"Enables verbose mode\")\n @click.option(\n     \"-f\", \"--force\", is_flag=True, help=\"Force download from non-approved host\"\n", "issue": "pyhf contrib download fails gracelessly with invalid URL\n# Description\r\n\r\ncalling `pyhf contrib download` (just to see what it does) fails pretty violently. hould we make itt a bit nicer @matthewfeickert \r\n?\r\n\r\n```\r\npyhf contrib download\r\nTraceback (most recent call last):\r\n  File \"/Users/lukasheinrich/Code/pyhfdev/dev/pyhfdevenv/bin/pyhf\", line 33, in <module>\r\n    sys.exit(load_entry_point('pyhf', 'console_scripts', 'pyhf')())\r\n  File \"/Users/lukasheinrich/Code/pyhfdev/dev/pyhfdevenv/lib/python3.7/site-packages/click/core.py\", line 829, in __call__\r\n    return self.main(*args, **kwargs)\r\n  File \"/Users/lukasheinrich/Code/pyhfdev/dev/pyhfdevenv/lib/python3.7/site-packages/click/core.py\", line 782, in main\r\n    rv = self.invoke(ctx)\r\n  File \"/Users/lukasheinrich/Code/pyhfdev/dev/pyhfdevenv/lib/python3.7/site-packages/click/core.py\", line 1259, in invoke\r\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\r\n  File \"/Users/lukasheinrich/Code/pyhfdev/dev/pyhfdevenv/lib/python3.7/site-packages/click/core.py\", line 1259, in invoke\r\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\r\n  File \"/Users/lukasheinrich/Code/pyhfdev/dev/pyhfdevenv/lib/python3.7/site-packages/click/core.py\", line 1066, in invoke\r\n    return ctx.invoke(self.callback, **ctx.params)\r\n  File \"/Users/lukasheinrich/Code/pyhfdev/dev/pyhfdevenv/lib/python3.7/site-packages/click/core.py\", line 610, in invoke\r\n    return callback(*args, **kwargs)\r\n  File \"/Users/lukasheinrich/Code/pyhfdev/dev/pyhfsrc/src/pyhf/cli/contrib.py\", line 60, in download\r\n    utils.download(archive_url, output_directory, force, compress)\r\n  File \"/Users/lukasheinrich/Code/pyhfdev/dev/pyhfsrc/src/pyhf/contrib/utils.py\", line 47, in download\r\n    + \"To download an archive from this host use the --force option.\"\r\npyhf.exceptions.InvalidArchiveHost:  is not an approved archive host: www.hepdata.net, doi.org\r\nTo download an archive from this host use the --force option.\r\n```\r\n\n", "before_files": [{"content": "\"\"\"CLI for functionality that will get migrated out eventually.\"\"\"\nimport logging\nimport click\nfrom pathlib import Path\n\nfrom ..contrib import utils\n\nlogging.basicConfig()\nlog = logging.getLogger(__name__)\n\n\n@click.group(name=\"contrib\")\ndef cli():\n    \"\"\"\n    Contrib experimental operations.\n\n    .. note::\n\n        Requires installation of the ``contrib`` extra.\n\n        .. code-block:: shell\n\n            $ python -m pip install pyhf[contrib]\n    \"\"\"\n\n\n@cli.command()\n@click.argument(\"archive-url\", default=\"-\")\n@click.argument(\"output-directory\", default=\"-\")\n@click.option(\"-v\", \"--verbose\", is_flag=True, help=\"Enables verbose mode\")\n@click.option(\n    \"-f\", \"--force\", is_flag=True, help=\"Force download from non-approved host\"\n)\n@click.option(\n    \"-c\",\n    \"--compress\",\n    is_flag=True,\n    help=\"Keep the archive in a compressed tar.gz form\",\n)\ndef download(archive_url, output_directory, verbose, force, compress):\n    \"\"\"\n    Download the patchset archive from the remote URL and extract it in a\n    directory at the path given.\n\n    Example:\n\n    .. code-block:: shell\n\n        $ pyhf contrib download --verbose https://www.hepdata.net/record/resource/1408476?view=true 1Lbb-likelihoods\n\n        \\b\n        1Lbb-likelihoods/patchset.json\n        1Lbb-likelihoods/README.md\n        1Lbb-likelihoods/BkgOnly.json\n\n    Raises:\n        :class:`~pyhf.exceptions.InvalidArchiveHost`: if the provided archive host name is not known to be valid\n    \"\"\"\n    try:\n        utils.download(archive_url, output_directory, force, compress)\n\n        if verbose:\n            file_list = [str(file) for file in list(Path(output_directory).glob(\"*\"))]\n            print(\"\\n\".join(file_list))\n    except AttributeError as excep:\n        exception_info = (\n            str(excep)\n            + \"\\nInstallation of the contrib extra is required to use the contrib CLI API\"\n            + \"\\nPlease install with: python -m pip install pyhf[contrib]\\n\"\n        )\n        log.error(exception_info)\n", "path": "src/pyhf/cli/contrib.py"}], "after_files": [{"content": "\"\"\"CLI for functionality that will get migrated out eventually.\"\"\"\nimport logging\nimport click\nfrom pathlib import Path\n\nfrom ..contrib import utils\n\nlogging.basicConfig()\nlog = logging.getLogger(__name__)\n\n\n@click.group(name=\"contrib\")\ndef cli():\n    \"\"\"\n    Contrib experimental operations.\n\n    .. note::\n\n        Requires installation of the ``contrib`` extra.\n\n        .. code-block:: shell\n\n            $ python -m pip install pyhf[contrib]\n    \"\"\"\n\n\n@cli.command()\n@click.argument(\"archive-url\")\n@click.argument(\"output-directory\")\n@click.option(\"-v\", \"--verbose\", is_flag=True, help=\"Enables verbose mode\")\n@click.option(\n    \"-f\", \"--force\", is_flag=True, help=\"Force download from non-approved host\"\n)\n@click.option(\n    \"-c\",\n    \"--compress\",\n    is_flag=True,\n    help=\"Keep the archive in a compressed tar.gz form\",\n)\ndef download(archive_url, output_directory, verbose, force, compress):\n    \"\"\"\n    Download the patchset archive from the remote URL and extract it in a\n    directory at the path given.\n\n    Example:\n\n    .. code-block:: shell\n\n        $ pyhf contrib download --verbose https://www.hepdata.net/record/resource/1408476?view=true 1Lbb-likelihoods\n\n        \\b\n        1Lbb-likelihoods/patchset.json\n        1Lbb-likelihoods/README.md\n        1Lbb-likelihoods/BkgOnly.json\n\n    Raises:\n        :class:`~pyhf.exceptions.InvalidArchiveHost`: if the provided archive host name is not known to be valid\n    \"\"\"\n    try:\n        utils.download(archive_url, output_directory, force, compress)\n\n        if verbose:\n            file_list = [str(file) for file in list(Path(output_directory).glob(\"*\"))]\n            print(\"\\n\".join(file_list))\n    except AttributeError as excep:\n        exception_info = (\n            str(excep)\n            + \"\\nInstallation of the contrib extra is required to use the contrib CLI API\"\n            + \"\\nPlease install with: python -m pip install pyhf[contrib]\\n\"\n        )\n        log.error(exception_info)\n", "path": "src/pyhf/cli/contrib.py"}]}