File tree Expand file tree Collapse file tree
drift/instrumentation/aiohttp Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -818,10 +818,21 @@ def headers(self):
818818 """Return headers as a dict-like object."""
819819 return self ._headers
820820
821+ def _get_header (self , name : str ) -> str | None :
822+ """Get header value with case-insensitive lookup.
823+
824+ HTTP headers are case-insensitive per RFC 7230.
825+ """
826+ name_lower = name .lower ()
827+ for key , value in self ._headers .items ():
828+ if key .lower () == name_lower :
829+ return value
830+ return None
831+
821832 @property
822833 def content_type (self ) -> str :
823- """Return content type from headers."""
824- return self ._headers . get ("content-type" , "application/octet-stream" )
834+ """Return content type from headers (case-insensitive lookup) ."""
835+ return self ._get_header ("content-type" ) or "application/octet-stream"
825836
826837 async def read (self ) -> bytes :
827838 """Read response body."""
You can’t perform that action at this time.
0 commit comments