WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
18676
Plug-In API Proposal: Enable plugins to receive response body when an HTTP error occurs
https://bugs.webkit.org/show_bug.cgi?id=18676
Summary
Plug-In API Proposal: Enable plugins to receive response body when an HTTP er...
Dimcho Balev
Reported
2008-04-22 00:33:06 PDT
Many flash developers have continuously asked Adobe for several HTTP related changes in the flash player. They really need: 1. Access to the HTTP status code 2. Access to the HTTP response headers 3. Access to the HTTP body even when the http request is unsuccessful Response headers and status codes (1 & 2) are already available (in up-to-date browsers) via the NPStream struct passed to NPP_NewStream. The only missing part is the HTTP bodies (3) on failed http requests. I have filed similar bug for Firefox:
https://bugzilla.mozilla.org/show_bug.cgi?id=347805
The difference between FireFox and Safari is that on http error Safari still sends NPN_NewStream to the plugin and it is possible to retrieve the http status code. As with Firefox, Safari does not send NPP_Write and thus prevents the plugin of receiving the http body. Here is the proposal that should solve this issue while remaining compatible with older code: In the cases of http errors the browser should asks the plugin if it is interested in receiving the body of failed request - it should call NPP_GetValue with new enum called NPPVpluginWantsHTTPFailStreams = 17. If the plugin does not understand what the browser is asking or if the plugin is not interested everything will work as before. In the other case the browser should send NPP_NewStream, NPP_WriteReady, NPP_Write, and NPP_DestroyStream as it does for urls that return 200 OK.
Attachments
First crude patch (mac only)
(5.60 KB, patch)
2008-04-22 00:39 PDT
,
Dimcho Balev
no flags
Details
Formatted Diff
Diff
Updated the patch with new constant name and value
(5.77 KB, patch)
2008-05-29 16:50 PDT
,
Dimcho Balev
no flags
Details
Formatted Diff
Diff
Fixed a bug about missing http status line. Added Windows/Linux code
(10.49 KB, patch)
2008-07-15 18:59 PDT
,
Dimcho Balev
andersca
: review+
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Dimcho Balev
Comment 1
2008-04-22 00:39:59 PDT
Created
attachment 20745
[details]
First crude patch (mac only) This is my first patch. I realize that it is Mac only and will break the windows build. I am also no sure if it modifies the right classes. I just wanted to have something concrete that will help having more focused discussions.
Anders Carlsson
Comment 2
2008-04-22 17:03:32 PDT
The approach looks good and should work well on both Windows and Mac. The patch does violate the Web Kit style guidelines described on
http://webkit.org/coding/coding-style.html
but other than that I think it is a great idea.
Dimcho Balev
Comment 3
2008-05-29 16:50:52 PDT
Created
attachment 21423
[details]
Updated the patch with new constant name and value
Dimcho Balev
Comment 4
2008-07-15 18:59:25 PDT
Created
attachment 22298
[details]
Fixed a bug about missing http status line. Added Windows/Linux code - This patch includes the corresponding code for Windows/Linux that was absent from the previous patches (they updated the Mac version only). - I also added a fix for windows specific bug about missing http status line from the http headers that webkit passes to the plugins. - Some minor format changes
Anders Carlsson
Comment 5
2008-07-28 12:21:10 PDT
<
rdar://problem/6106578
>
Anders Carlsson
Comment 6
2008-07-28 12:24:47 PDT
Comment on
attachment 22298
[details]
Fixed a bug about missing http status line. Added Windows/Linux code Looks great. I've committed it with a few tweaks. I haven't committed the Windows parts but that's next. (I didn't commit the header changes. Could you please file a new bug for that?)
Dimcho Balev
Comment 7
2008-07-28 14:59:34 PDT
Logged a separate bug for the missing status line on windows:
Bug 20202
Anders Carlsson
Comment 8
2008-07-28 17:38:32 PDT
Committed revision 35417.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug