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

Fix type of aiohttp raw headers #161

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rsmeral
Copy link
Contributor

@rsmeral rsmeral commented Jan 19, 2025

Description

aiohttp's ClientResponse.raw_headers is supposed to be "unconverted bytes".

Pook was setting the keys and values of raw_headers as string instead of bytes.

This was causing issues in clients which expect the headers to be bytes, for example aiobotocore tries to decode() header names and values which then fails with AttributeError: 'str' object has no attribute 'decode'.
See https://github.com/aio-libs/aiobotocore/blob/master/aiobotocore/endpoint.py#L41-L56

PR Checklist

  • I've added tests for any code changes
  • I've documented any new features

@sarayourfriend
Copy link
Collaborator

Thanks again @rsmeral. I'll review this later today or sometime tomorrow 🙂

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