From 43cf78d99ea016a4487f6855886a09f67d928b3d Mon Sep 17 00:00:00 2001 From: andrejborstnik Date: Mon, 3 Oct 2022 10:32:29 -0700 Subject: [PATCH] chore: add headers.Content-type to openFileInEditor call (#33517) Summary: Currently the `Content-type` is not defined and defaults to `text/plain`. This makes it more accurate. ## Changelog [internal] [Changed] - add `headers.Content-type` to `openFileInEditor` call Pull Request resolved: https://github.com/facebook/react-native/pull/33517 Test Plan: - [x] in development trigger `openFileInEditor`, e.g. by pressing on a line in a stack trace -> code editor opens Reviewed By: cipolleschi Differential Revision: D40022413 Pulled By: cortinico fbshipit-source-id: 00ad3cdcdd1f82436c04aed3643c9f0b55778592 --- Libraries/Core/Devtools/openFileInEditor.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Libraries/Core/Devtools/openFileInEditor.js b/Libraries/Core/Devtools/openFileInEditor.js index 2f4e8b127d2..c9eb343031e 100644 --- a/Libraries/Core/Devtools/openFileInEditor.js +++ b/Libraries/Core/Devtools/openFileInEditor.js @@ -15,6 +15,9 @@ const getDevServer = require('./getDevServer'); function openFileInEditor(file: string, lineNumber: number) { fetch(getDevServer().url + 'open-stack-frame', { method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, body: JSON.stringify({file, lineNumber}), }); }