Skip to content

Commit

Permalink
shopinvader_cache_invalidation: fix url and use urljoin
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienbeau committed Jan 21, 2025
1 parent 16b28a9 commit 6985891
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import logging

import requests
from urllib.parse import urljoin

from odoo import fields, models

Expand Down Expand Up @@ -61,7 +62,7 @@ def purge_url(self):
s.headers.update({"X-force-cache-refresh": backend.cache_refresh_secret})
for record in self:
if record.backend_id == backend:
url = f"{record.backend_id.location}/{record.url}"
url = urljoin(record.backend_id.location, record.url)
try:
response = s.get(url)
if response.status_code != 200:
Expand Down

0 comments on commit 6985891

Please sign in to comment.