diff --git a/fsspec/implementations/http.py b/fsspec/implementations/http.py index 093fa29be..b8ebec059 100644 --- a/fsspec/implementations/http.py +++ b/fsspec/implementations/http.py @@ -43,6 +43,7 @@ class HTTPFileSystem(AsyncFileSystem): HTML href tags will be used. """ + protocol = ("http", "https") sep = "/" def __init__( diff --git a/fsspec/implementations/tests/test_http.py b/fsspec/implementations/tests/test_http.py index d014d1155..869a02680 100644 --- a/fsspec/implementations/tests/test_http.py +++ b/fsspec/implementations/tests/test_http.py @@ -630,3 +630,15 @@ def test_pipe_file(server, tmpdir, reset_files): bytesio = io.BytesIO(b"BytesIO content") fs.pipe_file(server.address + "/piped_bytes", bytesio.getvalue()) assert fs.cat(server.address + "/piped_bytes") == b"BytesIO content" + + +@pytest.mark.parametrize("protocol", ["http", "https"]) +def test_protocol_independent_of_first_used_protocol(protocol): + from fsspec import filesystem + + filesystem(protocol) + fs0 = filesystem("http") + p0 = fs0.protocol[0] if isinstance(fs0.protocol, tuple) else fs0.protocol + fs1 = filesystem("https") + p1 = fs1.protocol[0] if isinstance(fs1.protocol, tuple) else fs1.protocol + assert p0 == p1 == "http"