mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
43cf78d99e
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: 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
26 lines
573 B
JavaScript
26 lines
573 B
JavaScript
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @format
|
|
* @flow strict
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
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}),
|
|
});
|
|
}
|
|
|
|
module.exports = openFileInEditor;
|