Skip to content

Commit

Permalink
Allowedmethods (#199)
Browse files Browse the repository at this point in the history
* remove allowed_methods in httpconn

* remove h5serv ref from httpconn.py
  • Loading branch information
jreadey committed May 15, 2024
1 parent c2d34a2 commit 837932f
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions h5pyd/_hl/httpconn.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright by The HDF Group. #
# All rights reserved. #
# #
# This file is part of H5Serv (HDF5 REST Server) Service, Libraries and #
# This file is part of HSDS (HDF5 REST Server) Service, Libraries and #
# Utilities. The full HDF5 REST Server copyright notice, including #
# terms governing use, modification, and redistribution, is contained in #
# the file COPYING, which can be found at the root of the source code #
Expand Down Expand Up @@ -200,8 +200,6 @@ def __init__(
if endpoint is None:
if "HS_ENDPOINT" in os.environ:
endpoint = os.environ["HS_ENDPOINT"]
elif "H5SERV_ENDPOINT" in os.environ:
endpoint = os.environ["H5SERV_ENDPOINT"]

if not endpoint:
msg = "no endpoint set"
Expand Down Expand Up @@ -265,17 +263,13 @@ def __init__(
if username is None:
if "HS_USERNAME" in os.environ:
username = os.environ["HS_USERNAME"]
elif "H5SERV_USERNAME" in os.environ:
username = os.environ["H5SERV_USERNAME"]
if isinstance(username, str) and (not username or username.upper() == "NONE"):
username = None
self._username = username

if password is None:
if "HS_PASSWORD" in os.environ:
password = os.environ["HS_PASSWORD"]
elif "H5SERV_PASSWORD" in os.environ:
password = os.environ["H5SERV_PASSWORD"]
if isinstance(password, str) and (not password or password.upper() == "NONE"):
password = None
self._password = password
Expand Down Expand Up @@ -718,15 +712,7 @@ def session(self):
backoff_factor = 1
status_forcelist = (500, 502, 503, 504)
lambda_prefix = requests_lambda.LAMBDA_REQ_PREFIX
allowed_methods = [
"HEAD",
"GET",
"PUT",
"DELETE",
"OPTIONS",
"TRACE",
"POST",
] # include POST retries

if self._use_session:
if self._s is None:
if self._endpoint.startswith("http+unix://"):
Expand All @@ -744,7 +730,6 @@ def session(self):
connect=retries,
backoff_factor=backoff_factor,
status_forcelist=status_forcelist,
allowed_methods=allowed_methods,
)

s.mount(
Expand Down

0 comments on commit 837932f

Please sign in to comment.