httpie/cli

HTTPie could be lead to believe data was passed in stdin when it was not

Ousret opened this issue · 1 comments

Minimal reproduction code and steps

FROM python:3.11

RUN pip install httpie
$ docker build -t httpie .
$ docker run httpie https pie.dev/get

Current result

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>405 Method Not Allowed</title>
<h1>Method Not Allowed</h1>
<p>The method is not allowed for the requested URL.</p>

Expected result

Well, not sending a POST request.


The condition, that verify stdin data is insufficient, unfortunately. Containerized environments seems to be the most concerned at the time. Due to the missing "interactive" mode.

# see argparser.py
self.has_stdin_data = (
    self.env.stdin
    and not self.args.ignore_stdin
    and not self.env.stdin_isatty
)

A fix has been created.