Content-Length: 301317 | pFad | https://github.com/googleapis/python-storage/issues/121

82 Move bucket_bound_hostname code into helper · Issue #121 · googleapis/python-storage · GitHub
Skip to content

Move bucket_bound_hostname code into helper #121

Closed
@IlyaFaer

Description

@IlyaFaer

For now we have three places in which we're using bucket_bound_hostname. The code is almost the same in all three places, so it'll be good to union it in single helper:

if ":" in bucket_bound_hostname:
api_access_endpoint = bucket_bound_hostname
else:
api_access_endpoint = "{scheme}://{bucket_bound_hostname}".format(
scheme=scheme, bucket_bound_hostname=bucket_bound_hostname
)

if ":" in bucket_bound_hostname:
api_access_endpoint = bucket_bound_hostname
else:
api_access_endpoint = "{scheme}://{bucket_bound_hostname}".format(
scheme=scheme, bucket_bound_hostname=bucket_bound_hostname
)

if ":" in bucket_bound_hostname: # URL includes scheme
url = bucket_bound_hostname
else: # scheme is given separately
url = "{scheme}://{host}/".format(
scheme=scheme, host=bucket_bound_hostname
)

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the googleapis/python-storage API.type: cleanupAn internal cleanup or hygiene concern.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions









    ApplySandwichStrip

    pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


    --- a PPN by Garber Painting Akron. With Image Size Reduction included!

    Fetched URL: https://github.com/googleapis/python-storage/issues/121

    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy