Add Content-Type header to dev server requests (#49042)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49042

Minor fix to align with adjacent `/open-stack-frame` call: https://fburl.com/code/o9rwbmxr.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D68830215

fbshipit-source-id: 87ef0c14bdedd34153014721b85bd24af24c1db7
This commit is contained in:
Alex Hunt
2025-01-29 09:18:46 -08:00
committed by Facebook GitHub Bot
parent 26afc804b7
commit 97ee93fd5a
2 changed files with 6 additions and 0 deletions
@@ -16,6 +16,9 @@ export default function openURLInBrowser(url: string) {
// $FlowFixMe[unused-promise]
fetch(getDevServer().url + 'open-url', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({url}),
});
}
@@ -42,6 +42,9 @@ export default async function symbolicateStackTrace(
const fetch = global.fetch ?? require('../../Network/fetch');
const response = await fetch(devServer.url + 'symbolicate', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({stack, extraData}),
});
return await response.json();