Icecast header response is both 400 and 200

随声附和 提交于 2021-01-28 19:01:23

问题


I have Icecast 2.4.4 running on a Windows box at sub.domain.org. My website is on a different server at domain.org.

When I SSH into my Linux host shell and run curl to the mount point I get a response of 400, but if I do wget I get a response of 200. How can this be?

# wget https://sub.domain.org/live.mp3
--2018-12-19 17:52:58--  https://sub.domain.org/live.mp3 Resolving sub.domain.org... 111.111.111.111 Connecting to
sub.domain.org|111.111.111.111|:443... connected. HTTP request sent,
awaiting **response... 200 OK** Length: unspecified [audio/mpeg] Saving
to: `live.mp3'

    [                        <=>                 ] 96,600      3.93K/s              ^C

# curl --head  https://sub.domain.org/live.mp3
HTTP/1.0 **400 Bad Request**
Server: Icecast 2.4.4
Connection: Close Date: Thu, 20 Dec 2018
00:53:32 GMT Content-Type: text/html; charset=utf-8 Cache-Control:
no-cache, no-store Expires: Mon, 26 Jul 1997 05:00:00 GMT Pragma:
no-cache Access-Control-Allow-Origin: *

回答1:


Because in case of cURL you are passing the --head parameter. This tells cURL to make a HTTP HEAD request instead of the HTTP GET request that wget performs.

Icecast does not support HTTP HEAD requests and thus the HTTP 400 response is fully justified.



来源:https://stackoverflow.com/questions/53861678/icecast-header-response-is-both-400-and-200

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!