fix: send both Espo-Authorization and X-Api-Key for opcache clear

The platform stores API keys as base64-encoded Espo-Authorization,
not raw API keys. Send both headers so opcache-clear.php can validate.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-05 12:18:26 +00:00
parent 08995b9027
commit 9bbac18b1a
+1 -1
View File
@@ -311,7 +311,7 @@ def _clear_opcache(customer, espo_url, api_key):
try: try:
oc_req = urllib.request.Request( oc_req = urllib.request.Request(
f'{espo_url}/opcache-clear.php', f'{espo_url}/opcache-clear.php',
headers={'X-Api-Key': api_key}, headers={'Espo-Authorization': api_key, 'X-Api-Key': api_key},
method='GET', method='GET',
) )
oc_resp = urllib.request.urlopen(oc_req, context=SSL_CTX, timeout=10) oc_resp = urllib.request.urlopen(oc_req, context=SSL_CTX, timeout=10)