cli icon indicating copy to clipboard operation
cli copied to clipboard

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

Open Ousret opened this issue 1 year ago • 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.

Ousret avatar Jan 10 '24 19:01 Ousret

Additional evidences https://github.com/Ousret/httpie-test/actions/runs/7470321266/job/20328824310

Ousret avatar Jan 10 '24 19:01 Ousret