[FFmpeg-devel] [PATCH] http: handle URLs with spaces
Andrey Utkin
andrey.krieger.utkin at gmail.com
Sun Feb 2 16:51:36 CET 2014
2014-02-02 wm4 <nfxjfg at googlemail.com>:
> What I'm advocating here is that http.c should always escape disallowed
> characters (like spaces), because making HTTP requests with them
> unescaped is always invalid - thus it's 100% safe to escape them.
Replacing only spaces is a very surprising action - it is not
urlencoding and not passing query unchanged. There is even no name for
such conversion. It is definitely surprising unreasoned nasty thing to
do.
It is better if query fails and user figures out that the reason is
non-urlencoded query, than if it silently passes and then user pulls
out their hair from all places because urldecode on server side fails
or returns wrong values.
> Also, IMHO, http.c shouldn't mess with URLs that are perfectly valid.
But you want to do it. As i have said earlier, if query already
contains sth like %20, you cannot know whether it is already
urlencoded or not, if you don't ask user.
Leaving %-stuff untouched and replacing only spaces is not acceptable
as i stated above. ffmpeg behaviour would be misleading and results
would be surprising. Surprises (even pleasant at some situations)
should be avoided in engineering.
It is sufficiently simple for WWW user to get the concept of
urlencoding. IMO disabled-by-default option for urlencoding would be
acceptable.
--
Andrey Utkin
More information about the ffmpeg-devel
mailing list