ADT fallback: Accept headers for FUNC; G0189 accepted; regen2 results
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aUaQeLnwbb1zTpN7kHeat
This commit is contained in:
@@ -83,10 +83,11 @@ class AdtClient:
|
||||
"dataname=com.sap.adt.lock.result"))
|
||||
lh = re.search(r"<LOCK_HANDLE>(.*?)</LOCK_HANDLE>", t).group(1)
|
||||
try:
|
||||
# FUNC needs an Accept header (PROG does not): "Accept header missing" (G0189)
|
||||
self._req("PUT", f"{uri}/source/main?lockHandle={lh}", source,
|
||||
dict(st, **{"Content-Type": "text/plain; charset=utf-8"}))
|
||||
dict(st, **{"Content-Type": "text/plain; charset=utf-8", "Accept": "text/plain"}))
|
||||
finally:
|
||||
self._req("POST", f"{uri}?_action=UNLOCK&lockHandle={lh}", None, st)
|
||||
self._req("POST", f"{uri}?_action=UNLOCK&lockHandle={lh}", None, dict(st, Accept="*/*"))
|
||||
body = ('<?xml version="1.0" encoding="UTF-8"?><adtcore:objectReferences '
|
||||
'xmlns:adtcore="http://www.sap.com/adt/core">'
|
||||
f'<adtcore:objectReference adtcore:uri={quoteattr(uri)} adtcore:name={quoteattr(name)}/>'
|
||||
|
||||
@@ -153,7 +153,8 @@ class ToolProxy:
|
||||
self.adt = AdtClient()
|
||||
done, msgs = self.adt.write_activate(uri, name.upper(), args.get("source", ""))
|
||||
except Exception as e: # noqa: BLE001 keep the EPOD result when the fallback fails
|
||||
self.fallbacks.append({"object": name, "error": str(e)[:200]})
|
||||
body = e.read().decode(errors="replace")[:600] if hasattr(e, "read") else ""
|
||||
self.fallbacks.append({"object": name, "error": str(e)[:200], "body": body})
|
||||
return err, text
|
||||
self.fallbacks.append({"object": name, "activated": done})
|
||||
out = {"success": done,
|
||||
|
||||
Reference in New Issue
Block a user