-
-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clean up getdomain logic #368
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -268,7 +268,7 @@ def validateDomainKey(domain_key): | |
|
||
|
||
def getDomainFromRequest(request, validate=True): | ||
# print("gotDomainFromRequest:", request, "validate=", validate) | ||
print(f"tmp - getDomainFromRequest: {request}, validate={validate}") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like a debug print was left in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed |
||
app = request.app | ||
domain = None | ||
bucket = None | ||
|
@@ -279,7 +279,7 @@ def getDomainFromRequest(request, validate=True): | |
domain = request.headers["X-Hdf-domain"] | ||
else: | ||
return None | ||
|
||
print(f"tmp - domain: {domain}") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed |
||
if domain.startswith("hdf5:/"): | ||
# strip off the prefix to make following logic easier | ||
domain = domain[6:] | ||
|
@@ -297,8 +297,8 @@ def getDomainFromRequest(request, validate=True): | |
else: | ||
pass # no bucket specified | ||
|
||
if bucket and validate: | ||
if not isValidBucketName(bucket): | ||
if bucket: | ||
if validate and not isValidBucketName(bucket): | ||
raise ValueError(f"bucket name: {bucket} is not valid") | ||
if domain[0] == "/": | ||
domain = bucket + domain | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
relevent
->relevant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed