Skip to content

Commit 07ff9b5

Browse files
stainless-app[bot]batuhan
authored andcommitted
fix: avoid reading from stdin unless request body is form encoded or json
1 parent dd5b6e3 commit 07ff9b5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pkg/cmd/flagoptions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ func flagOptions(
219219

220220
requestContents := requestflag.ExtractRequestContents(cmd)
221221

222-
if bodyType != ApplicationOctetStream && isInputPiped() && !ignoreStdin {
222+
if (bodyType == MultipartFormEncoded || bodyType == ApplicationJSON) && !ignoreStdin && isInputPiped() {
223223
pipeData, err := io.ReadAll(os.Stdin)
224224
if err != nil {
225225
return nil, err

0 commit comments

Comments
 (0)