Skip to content

Commit

Permalink
fix: provide authentification in POST requests
Browse files Browse the repository at this point in the history
we didn't pass the user ID nor the password previously
  • Loading branch information
raphael0202 committed Nov 10, 2023
1 parent 7f4b7fd commit 545bbe9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions openfoodfacts/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ def send_get_request(
def send_for_urlencoded_post_request(
url: str, body: Dict[str, Any], api_config: APIConfig
) -> requests.Response:
if api_config.username and api_config.password:
body["user_id"] = api_config.username
body["password"] = api_config.password
r = http_session.post(
url,
data=body,
Expand Down

0 comments on commit 545bbe9

Please sign in to comment.