Skip to content

Commit 07f8508

Browse files
authored
Fix render_ssr page data json encoding
Encode page data for SSR rendering with the INERTIA_JSON_ENCODER.
1 parent 5591683 commit 07f8508

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

inertia/http.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ def build_props():
3939
return deep_transform_callables(_props)
4040

4141
def render_ssr():
42-
response = requests.post(f'{settings.INERTIA_SSR_URL}/render', json=page_data())
42+
data = json_encode(page_data(), cls=settings.INERTIA_JSON_ENCODER)
43+
response = requests.post(
44+
f"{settings.INERTIA_SSR_URL}/render",
45+
data=data,
46+
headers={"Content-Type": "application/json"},
47+
)
4348
response.raise_for_status()
4449
return base_render(request, 'inertia_ssr.html', {
4550
'inertia_layout': settings.INERTIA_LAYOUT,

0 commit comments

Comments
 (0)