Skip to content

Commit

Permalink
chore: add headers.Content-type to openFileInEditor call (#33517)
Browse files Browse the repository at this point in the history
Summary:
Currently the `Content-type` is not defined and defaults to `text/plain`. This makes it more accurate.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[internal] [Changed] - add `headers.Content-type` to `openFileInEditor` call

Pull Request resolved: #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
  • Loading branch information
andrejborstnik authored and facebook-github-bot committed Oct 3, 2022
1 parent 75b688f commit 43cf78d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Libraries/Core/Devtools/openFileInEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}),
});
}
Expand Down

0 comments on commit 43cf78d

Please sign in to comment.