The Wayback Machine - https://web.archive.org/web/20200716091146/https://github.com/jakubroztocil/httpie/issues/689
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't change output filename from Content-Type or make it optional #689

Open
Maryse47 opened this issue Jul 13, 2018 · 0 comments
Open

Don't change output filename from Content-Type or make it optional #689

Maryse47 opened this issue Jul 13, 2018 · 0 comments

Comments

@Maryse47
Copy link

@Maryse47 Maryse47 commented Jul 13, 2018

Current behavior can do more harm than good:

http --debug --download https://raw.githubusercontent.com/jakubroztocil/httpie/master/Makefile
HTTPie 0.9.9
Requests 2.19.1
Pygments 2.2.0
Python 3.6.6 (default) 
[GCC 8.1.1]
/usr/bin/python3
Linux 4.18.0

<Environment {
    "colors": 256,
    "config": {
        "__meta__": {
            "about": "HTTPie configuration file",
            "help": "https://httpie.org/docs#config",
            "httpie": "0.9.9"
        },
        "default_options": "[]"
    },
    "config_dir": "/home/user/.httpie",
    "is_windows": false,
    "stderr": "<_io.TextIOWrapper name='<stderr>' mode='w' encoding='UTF-8'>",
    "stderr_isatty": true,
    "stdin": "<_io.TextIOWrapper name='<stdin>' mode='r' encoding='UTF-8'>",
    "stdin_encoding": "UTF-8",
    "stdin_isatty": true,
    "stdout": "<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>",
    "stdout_encoding": "UTF-8",
    "stdout_isatty": true
}>

>>> requests.request(**{
    "allow_redirects": true,
    "auth": "None",
    "cert": "None",
    "data": {},
    "files": {},
    "headers": {
        "Accept-Encoding": "identity",
        "User-Agent": "HTTPie/0.9.9"
    },
    "method": "get",
    "params": {},
    "proxies": {},
    "stream": true,
    "timeout": 30,
    "url": "https://raw.githubusercontent.com/jakubroztocil/httpie/master/Makefile",
    "verify": true
})

HTTP/1.1 200 OK
Accept-Ranges: bytes
Access-Control-Allow-Origin: *
Cache-Control: max-age=300
Connection: keep-alive
Content-Length: 3257
Content-Security-Policy: default-src 'none'; style-src 'unsafe-inline'; sandbox
Content-Type: text/plain; charset=utf-8
Date: xxx GMT
ETag: "xxx"
Expires: xxx GMT
Source-Age: 98
Strict-Transport-Security: max-age=31536000
Vary: Authorization,Accept-Encoding
Via: 1.1 varnish
X-Cache: HIT
X-Cache-Hits: 1
X-Content-Type-Options: nosniff
X-Fastly-Request-ID: xxx
X-Frame-Options: deny
X-Geo-Block-List: 
X-GitHub-Request-Id: xxx
X-Served-By: cache-xxx
X-Timer: xxx
X-XSS-Protection: 1; mode=block

Downloading 3.18 kB to "Makefile.txt"
Done. 3.18 kB in 0.00121s (2.57 MB/s)
@Maryse47 Maryse47 changed the title Downloading "Content-Type: text/plain" files will append .txt at the end of filename Don't automatically append extension to downloaded filename or make it optional Jul 15, 2018
@Maryse47 Maryse47 changed the title Don't automatically append extension to downloaded filename or make it optional Don't change output filename from Content-Type or make it optional Jul 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.