Skip to content

VLC does not send a HTTP Host header

When attempting to open a network stream over a password protected resource from an http server, vlc does not sent the host header when it sends the correct credentials, causing the http server to respond with a 400 error. When vlc does eventually send the host header with the request, it doesn't send the credentials for some reason and the server sends a 401 error, causing vlc to give up and tell the user "Your input can't be opened: ..." when in fact the link works perfectly fine in a normal browser.

The link I tried to use was in this format(I don't want to share the link due to privacy concerns): http://username:password@www.example.com/path/to/file.mp3

Again for clarity here's what I've been able to tell is happening:

User clicks open network stream and enters their url:

  • VLC sends the creds with the request but neglects the host header
  • HTTP server sends a 400 error due to lack of host header(as defined here )
  • VLC repeats the same request but in HTTP/1.0 for some odd reason
  • HTTP server either sends another 400 error for the same reason as before, or cannot find the file because no host was specified
  • VLC drops the credentials and sends the request again with the host header
  • HTTP server rejects the request with a 401 error due to lack of credentials
  • VLC gives up and tells the user the input cannot be opened

I would request that vlc always send the host header, or at least always when using HTTP/1.1, that way vlc never encounters the 400 error and this whole issue is prevented.

The version of VLC I used while observing this behavior is 2.2.1 Terry Pratchett (WeatherWax), but I believe I have also encountered it before in 2.1.5.

Edited by Rémi Denis-Courmont
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information