mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 18:25:00 +00:00
fix: handle potential None value in content-type header
This commit is contained in:
parent
053a6af9dc
commit
bdded55e17
1 changed files with 5 additions and 3 deletions
|
@ -164,9 +164,11 @@ class Scraper:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
content = page.content()
|
content = page.content()
|
||||||
mime_type = (
|
mime_type = None
|
||||||
response.header_value("content-type").split(";")[0] if response else None
|
if response:
|
||||||
)
|
content_type = response.header_value("content-type")
|
||||||
|
if content_type:
|
||||||
|
mime_type = content_type.split(";")[0]
|
||||||
except playwright._impl._errors.Error as e:
|
except playwright._impl._errors.Error as e:
|
||||||
self.print_error(f"Error retrieving page content: {str(e)}")
|
self.print_error(f"Error retrieving page content: {str(e)}")
|
||||||
content = None
|
content = None
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue