[FFmpeg-devel] [PATCH] Add space after commas in HTTP/RTSP auth header

Calvin Walton calvin.walton at kepstin.ca
Tue Oct 6 16:00:29 CEST 2015


On Thu, 2015-10-01 at 13:56 +0300, Andrey Utkin wrote:
> This fixes access to Grandstream cameras, which return 401 to ffmpeg
> otherwise.
> VLC sends Authorization: header with spaces between parameters, and
> it
> is known to work with Grandstream devices and broad range of other
> HTTP
> and RTSP servers, so author considers switching to such behaviour
> safe.
> Just for record - RFC 2617 (HTTP Auth) does not specify the need in
> spaces, so this is not a bug of FFmpeg.

For those curious about the updated versions of the HTTP/1.1 specs, the
current HTTP Auth RFC 7235 uses the # (list) ABNF from RFC 7230 section
7, which specifies the separator as "," surrounded by OWS (optional
whitespace). Section 3.2.3 says:

   The OWS rule is used where zero or more linear whitespace octets
   might appear.  For protocol elements where optional whitespace is
   preferred to improve readability, a sender SHOULD generate the
   optional whitespace as a single SP; otherwise, a sender SHOULD NOT
   generate optional whitespace except as needed to white out invalid or
   unwanted protocol elements during in-place message filtering.

So in this case, using ", " as the separator appears to be preferred
but not required by the RFCs. But it certainly doesn't require that the
space is present! I agree that this isn't really an FFmpeg bug, but
 switching to use ", " is probably a good idea regardless.

-- 
Calvin Walton <calvin.walton at kepstin.ca>



More information about the ffmpeg-devel mailing list