REGRESSION(r243197): [GStreamer] Error playing redirected streams
https://bugs.webkit.org/show_bug.cgi?id=197410

Reviewed by Carlos Garcia Campos.

Revert the change introduced in r243197 that was checking the
redirected URI instead of the original URI. Non-main URIs should
be ignored only when they are HLS (or similar) fragments.

Test http/tests/security/canvas-remote-read-remote-video-hls.html still passes.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@245054 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 6210b94..7cf4afb 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2019-05-08  Philippe Normand  <pnormand@igalia.com>
+
+        REGRESSION(r243197): [GStreamer] Error playing redirected streams
+        https://bugs.webkit.org/show_bug.cgi?id=197410
+
+        Reviewed by Carlos Garcia Campos.
+
+        Revert the change introduced in r243197 that was checking the
+        redirected URI instead of the original URI. Non-main URIs should
+        be ignored only when they are HLS (or similar) fragments.
+
+        Test http/tests/security/canvas-remote-read-remote-video-hls.html still passes.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
+
 2019-05-08  Rob Buis  <rbuis@igalia.com>
 
         Link prefetch not useful for top-level navigation
diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
index 319f366..4a6dabf 100644
--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
@@ -1351,9 +1351,8 @@
         }
 #endif
         else if (gst_structure_has_name(structure, "http-headers")) {
-            const char* redirectionUri = gst_structure_get_string(structure, "redirection-uri");
-            const char* uri = redirectionUri ? redirectionUri : gst_structure_get_string(structure, "uri");
-            if (uri) {
+            GST_DEBUG_OBJECT(pipeline(), "Processing HTTP headers: %" GST_PTR_FORMAT, structure);
+            if (const char* uri = gst_structure_get_string(structure, "uri")) {
                 URL url(URL(), uri);
                 convertToInternalProtocol(url);
                 m_origins.add(SecurityOrigin::create(url));