Skip to content

Commit 8fdb033

Browse files
committed
chore: clean-up after 6db9323
1 parent 6db9323 commit 8fdb033

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

wikidict/utils.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -891,19 +891,17 @@ def render_formula(formula: str, *, cat: str = "tex", output_format: str = "svg"
891891
if cat == "chem":
892892
formula = f"\\ce{{{formula}}}"
893893

894-
headers = constants.WIKIMEDIA_HEADERS
895-
896894
# 1. Get the formula hash (type can be tex, inline-tex, or chem)
897895
url_hash = constants.WIKIMEDIA_URL_MATH_CHECK.format(type=cat)
898-
with constants.SESSION.post(url_hash, headers=headers, json={"q": formula}) as req:
896+
with constants.SESSION.post(url_hash, json={"q": formula}) as req:
899897
req.raise_for_status()
900898
res = req.json()
901899
assert res["success"]
902900
formula_hash = req.headers["x-resource-location"]
903901

904902
# 2. Get the rendered formula (format can be svg, mml, or png)
905903
url_render = constants.WIKIMEDIA_URL_MATH_RENDER.format(format=output_format, hash=formula_hash)
906-
with constants.SESSION.get(url_render, headers=headers) as req:
904+
with constants.SESSION.get(url_render) as req:
907905
req.raise_for_status()
908906
return req.text
909907

0 commit comments

Comments
 (0)