Bug 135839 - Media document sends incorrect referer header
Summary: Media document sends incorrect referer header
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Eric Carlson
Keywords: InRadar
Depends on:
Reported: 2014-08-12 06:50 PDT by Eric Carlson
Modified: 2014-08-13 10:25 PDT (History)
8 users (show)

See Also:

Proposed patch. (7.74 KB, patch)
2014-08-12 08:14 PDT, Eric Carlson
jer.noble: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Carlson 2014-08-12 06:50:55 PDT
FrameLoader::outgoingReferrer for a MediaDocument returns the url of the media file itself, not the page with the link to the media file.
Comment 1 Radar WebKit Bug Importer 2014-08-12 06:51:10 PDT
Comment 2 Eric Carlson 2014-08-12 08:14:38 PDT
Created attachment 236445 [details]
Proposed patch.
Comment 3 Jer Noble 2014-08-12 08:28:49 PDT
Comment on attachment 236445 [details]
Proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=236445&action=review

> Source/WebCore/html/MediaDocument.cpp:148
> +    if (frame)
> +        m_referrer = frame->loader().outgoingReferrer();

The Document class doesn't stash it's referrer; it fetches it from the loader each time it's requested.  I'm concerned that there may be some situation where we don't have a frame at creation time, but get one later.

(Though maybe it's something which Document has to worry about but not MediaDocument.)

Also, if we do decide to stash the outgoing referrer, we should probably name the variable m_outgoingReferrer.

Other than that nit, r=me.
Comment 4 Eric Carlson 2014-08-13 10:25:48 PDT
Committed r172523 : https://trac.webkit.org/r172523