Skip to content

Commit

Permalink
Prevent http client from converting our form data (#56772) (#56792)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
rylnd and elasticmachine authored Feb 5, 2020
1 parent 2b26a39 commit e23b586
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ export const importRules = async ({
`${DETECTION_ENGINE_RULES_URL}/_import`,
{
method: 'POST',
headers: { 'Content-Type': undefined },
query: { overwrite },
body: formData,
asResponse: true,
Expand Down

0 comments on commit e23b586

Please sign in to comment.