Skip to content

Commit fbef7dc

Browse files
fix(drawio): replace incorrect #H GitHub prefix with #R raw payload in drawio URLs (fixes #324)
- Draw.io uses #H for GitHub repository storage, triggering OAuth authorization - Draw.io uses #R for raw compressed diagram payloads, which render in-memory without auth - Update url_utils.py to prefix with https://app.diagrams.net/#R
1 parent 4c84009 commit fbef7dc

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎langgraph_engine/diagrams/drawio/url_utils.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ def get_shareable_url(xml_content, github_raw_url=None):
2929

3030

3131
def _encode_drawio_url(xml):
32-
"""Encode XML as draw.io URL fragment (#H format).
32+
"""Encode XML as draw.io URL fragment (#R format for raw payload).
3333
3434
Encoding steps (matching draw.io JavaScript):
3535
1. URL-encode the XML string
3636
2. Raw deflate compress (zlib with wbits=-15 equivalent)
3737
3. Base64 encode
3838
4. URL-encode the base64 string
39-
5. Prefix with https://app.diagrams.net/#H
39+
5. Prefix with https://app.diagrams.net/#R
4040
4141
Returns:
4242
Full shareable URL string.
@@ -49,7 +49,7 @@ def _encode_drawio_url(xml):
4949
compressed = zlib.compress(url_encoded.encode("utf-8"))
5050
raw_deflate = compressed[2:-4]
5151
b64 = base64.b64encode(raw_deflate).decode("ascii")
52-
return "https://app.diagrams.net/#H" + urllib.parse.quote(b64, safe="")
52+
return "https://app.diagrams.net/#R" + urllib.parse.quote(b64, safe="")
5353
except Exception as exc:
5454
logger.warning("Could not encode draw.io URL: %s", exc)
5555
return "https://app.diagrams.net/"

0 commit comments

Comments
 (0)