Merged from https://github.com/bbc/gst-curlhttpsrc commit f8aabcfc5c50a44f3362de831377d6e86dcd2d49 https://bugzilla.gnome.org/show_bug.cgi?id=744261