Commit 8f6933c
committed
fix: explicitly set Content-Type to text/plain for json serialization mode
Serialization mode:"json" uses Seroval special serialization format that is not valid JSON. Some runtimes (e.g. AWS Lambda) default to `application/json` when no `Content-Type` is set, causing downstream `JSON.parse` errors such as:
`SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data.`
When using "json" serialization mode, explicitly set `Content-Type` to `text/plain` for server-function responses to prevent incorrect parsing by runtimes. This restores the 2.x behavior, is safer for downstream environments, and is recommended best practice.1 parent c8e0697 commit 8f6933c
File tree
3 files changed
+18
-5
lines changed- .changeset
- packages/start/src/runtime
3 files changed
+18
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
157 | 161 | | |
158 | 162 | | |
159 | 163 | | |
| |||
181 | 185 | | |
182 | 186 | | |
183 | 187 | | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
184 | 192 | | |
185 | 193 | | |
186 | 194 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
| 80 | + | |
85 | 81 | | |
86 | 82 | | |
87 | 83 | | |
88 | 84 | | |
89 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
0 commit comments