Skip to content

Commit 1d17bbb

Browse files
committed
fix(writer): use session header for /init data - AB-179
1 parent 735afd4 commit 1d17bbb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/writer/app_runner.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,11 @@ def _handle_session_init(
178178
session.session_component_tree, mode=writer.Config.mode
179179
)
180180

181+
headers = session.headers or {}
181182
writer_application: Optional[WriterApplicationInformation] = None
182-
writer_app_id = os.getenv("WRITER_APP_ID")
183-
writer_org_id = os.getenv("WRITER_ORG_ID")
184-
writer_base_url = \
185-
os.getenv("WRITER_BASE_URL", "https://api.writer.com")
183+
writer_app_id = headers.get("x-agent-id") or os.getenv("WRITER_APP_ID")
184+
writer_org_id = headers.get("x-organization-id") or os.getenv("WRITER_ORG_ID")
185+
writer_base_url = os.getenv("WRITER_BASE_URL", "https://api.writer.com")
186186
if writer_app_id is not None and writer_org_id is not None:
187187
writer_application = WriterApplicationInformation(
188188
id=writer_app_id,

0 commit comments

Comments
 (0)