mirror of https://github.com/WikiTeam/wikiteam
monkey patch `requests.Response.text` to remove BOM header
parent
20691b56c5
commit
48670ab4db
@ -0,0 +1,6 @@
|
||||
import requests
|
||||
|
||||
def mod_requests_text(requests: requests):
|
||||
def new_text(self):
|
||||
return self.content.lstrip(b'\xef\xbb\xbf').decode(self.encoding)
|
||||
requests.Response.text = property(new_text)
|
Loading…
Reference in New Issue