Skip to content
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

Fixed broken request path from notebook with base url #14

Conversation

kevinpagtakhan
Copy link
Contributor

Issue

The derived downstream request path is incorrect for upstream request paths that contain Jupyter notebook base URL. For example, if the the upstream request path is asdf/awsproxy/..., the derived downstream removes the first 8 characters (the length of the string "/awsproxy") as it assumes it always just starts with "/awsproxy".

Solution

Consider that the upstream request path contains a base url. Find (1) the index of "/awsproxy", (2) the length of "/awsproxy". The sum of (1) and (2) is the starting index of the substring to derive the downstream request path.

# Given
upstream_request = HTTPServerRequest(
method="HEAD",
uri="base-url/awsproxy/bucket-name-1",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied an existing test, and changed the upstream request path to include a mock of a Jupyter notebook base url

@jaipreet-s jaipreet-s merged commit 07848ae into aws:master Feb 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants