Commit b640049
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 b640049
File tree
2 files changed
+13
-0
lines changed- .changeset
- packages/start/src/runtime
2 files changed
+13
-0
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 | | |
| |||
0 commit comments