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

handle 404 from the remotes #691

Merged
merged 5 commits into from
Sep 30, 2021
Merged

handle 404 from the remotes #691

merged 5 commits into from
Sep 30, 2021

Conversation

shadeofblue
Copy link
Contributor

@shadeofblue shadeofblue commented Sep 30, 2021

closes #692

@shadeofblue shadeofblue marked this pull request as ready for review September 30, 2021 11:53
@shadeofblue shadeofblue requested review from a team, kmazurek and johny-b September 30, 2021 11:53
@shadeofblue shadeofblue changed the title add ability to retrieve the nginx logs to the http_proxy example handle 404 from the remotes Sep 30, 2021
Copy link
Contributor

@johny-b johny-b left a comment

Choose a reason for hiding this comment

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

Two things I don't get + one not very important suggestion.

examples/http-proxy/http_proxy.py Show resolved Hide resolved
data: bytes = content.data
print(f"{TEXT_COLOR_GREEN}remote content: {data} {TEXT_COLOR_DEFAULT}")

response_text = data.decode("utf-8")
Copy link
Contributor

Choose a reason for hiding this comment

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

OK, just a stupid question.
Why do we decode headers with ascii and decode content with utf-8?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm, I'm unsure if headers are utf-8-encoded ...

ws_session = aiohttp.ClientSession()
async with ws_session.ws_connect(
instance_ws, headers={"Authorization": f"Bearer {app_key}"}
) as ws:
await ws.send_str(f"GET {query_string} HTTP/1.0\n\n")
await ws.send_str(f"GET {query_string} HTTP/1.0\r\n\r\n")
Copy link
Contributor

Choose a reason for hiding this comment

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

<3

examples/http-proxy/http_proxy.py Show resolved Hide resolved
@shadeofblue shadeofblue requested a review from johny-b September 30, 2021 13:04
Copy link
Contributor

@johny-b johny-b left a comment

Choose a reason for hiding this comment

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

thx for the comment

@shadeofblue shadeofblue merged commit 987c8af into b0.7 Sep 30, 2021
@shadeofblue shadeofblue deleted the blue/http-proxy-404-logs branch September 30, 2021 14:20
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