Skip to content

Commit e23b586

Browse files
Prevent http client from converting our form data (#56772) (#56792)
If we don't specify an undefined content-type like so, the client attempts to convert our form data into a JSON string, and the backend returns an understandable 415. This fixes rule imports. Co-authored-by: Elastic Machine <[email protected]>
1 parent 2b26a39 commit e23b586

File tree

1 file changed

+1
-0
lines changed
  • x-pack/legacy/plugins/siem/public/containers/detection_engine/rules

1 file changed

+1
-0
lines changed

x-pack/legacy/plugins/siem/public/containers/detection_engine/rules/api.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ export const importRules = async ({
246246
`${DETECTION_ENGINE_RULES_URL}/_import`,
247247
{
248248
method: 'POST',
249+
headers: { 'Content-Type': undefined },
249250
query: { overwrite },
250251
body: formData,
251252
asResponse: true,

0 commit comments

Comments
 (0)