Skip to content

Cannot use ImageContent.from_url: 400 Bad Request #10108

@ZeJ0hn

Description

@ZeJ0hn

Describe the bug
Using ImageContent.from_url, since version 2.18.0, we are unable to fetch images because of key 'user-agent' which appears twice in the HTTPX headers. The URL used is a SAS URL of a storage account blob.
If we deep dive in the code, we can see that there are this 2 values :
'User-Agent': 'haystack/LinkContentFetcher/2.20.0'
And
'user-agent': 'python-httpx/0.28.1'

Error message
400 Bad Request

Expected behavior
A status code 200

To Reproduce

  • generate a SAS URL from image stored on Azure Storage Account
  • try to fetch the Image using ImageContent.from_url

System:

  • Haystack version (commit or version number): 2.20.0

Metadata

Metadata

Assignees

Labels

P1High priority, add to the next sprint

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions