Skip to content
Snippets Groups Projects
Commit 1f30c1cc authored by Andreas Domanowski's avatar Andreas Domanowski
Browse files

Add comment about "interesting" HTTP handling by HedgeDoc

parent 58fe4e54
No related branches found
No related tags found
1 merge request!1Hedgedoc import
...@@ -16,6 +16,7 @@ def import_single_document(instance_url, hedgedoc_free_url, content, session_id) ...@@ -16,6 +16,7 @@ def import_single_document(instance_url, hedgedoc_free_url, content, session_id)
headers = {"Cookie": f"connect.hedgeDoc.sid={session_id}", "Content-Type": "text/markdown"} headers = {"Cookie": f"connect.hedgeDoc.sid={session_id}", "Content-Type": "text/markdown"}
req = urllib.request.Request(request_url, data=str.encode(content), method='POST', headers=headers) req = urllib.request.Request(request_url, data=str.encode(content), method='POST', headers=headers)
# unfortunately, no error is thrown if a document is not created when session cookie is invalid
with urllib.request.urlopen(req) as response: with urllib.request.urlopen(req) as response:
return response.url return response.url
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment