[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
mjs
mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:34:20 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit ec370e81362bb1cb229ee6a718bcb57aa6200c55
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Apr 4 09:32:42 2003 +0000
WebFoundation:
Reviewed by Trey.
Made a return value mutable so callers can conveniently change it w/o allocating.g
* Misc.subproj/WebNSDataExtras.h:
* Misc.subproj/WebNSDataExtras.m:
(-[NSData _web_parseRFC822HeaderFields]): Declare return type as
NSMutableDictionary instead of NSDictionary. We were returning a
mutable one anyway.
WebKit:
Reviewed by Trey.
- fixed 3188914 - loop checking for Flash at http://www.scottsmind.com/celebrity_defacer/index.php
* Plugins.subproj/WebBaseNetscapePluginView.m:
(-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]): Take a mutable request,
and make sure to set referrer to the frame URL (as other browsers do).
(-[WebBaseNetscapePluginView getURLNotify:target:notifyData:]): pass an NSMutableURLRequest.
(-[WebBaseNetscapePluginView getURL:target:]): Likewise.
(-[WebBaseNetscapePluginView _postURLNotify:target:len:buf:file:notifyData:allowHeaders:]):
If the plug-in passes a Content-Length header, take it out of the
headers and truncate the content appropriately to make
WebFoundation happy.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4022 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index ee1582d..a948ba3 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,19 @@
+2003-04-04 Maciej Stachowiak <mjs at apple.com>
+
+ Reviewed by Trey.
+
+ - fixed 3188914 - loop checking for Flash at http://www.scottsmind.com/celebrity_defacer/index.php
+
+ * Plugins.subproj/WebBaseNetscapePluginView.m:
+ (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]): Take a mutable request,
+ and make sure to set referrer to the frame URL (as other browsers do).
+ (-[WebBaseNetscapePluginView getURLNotify:target:notifyData:]): pass an NSMutableURLRequest.
+ (-[WebBaseNetscapePluginView getURL:target:]): Likewise.
+ (-[WebBaseNetscapePluginView _postURLNotify:target:len:buf:file:notifyData:allowHeaders:]):
+ If the plug-in passes a Content-Length header, take it out of the
+ headers and truncate the content appropriately to make
+ WebFoundation happy.
+
2003-04-03 Richard Williamson <rjw at apple.com>
Fix checks for about: to avoid using our 'fake' request when
diff --git a/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m b/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
index f7aeef5..33c3a62 100644
--- a/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
+++ b/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
@@ -21,6 +21,7 @@
#import <WebKit/WebWindowOperationsDelegate.h>
#import <WebFoundation/WebAssertions.h>
+#import <WebFoundation/NSURLRequestPrivate.h>
#import <WebFoundation/WebNSDataExtras.h>
#import <WebFoundation/WebNSStringExtras.h>
@@ -1168,7 +1169,7 @@ typedef struct {
}
}
-- (NPError)loadRequest:(NSURLRequest *)request inTarget:(const char *)cTarget withNotifyData:(void *)notifyData
+- (NPError)loadRequest:(NSMutableURLRequest *)request inTarget:(const char *)cTarget withNotifyData:(void *)notifyData
{
if (![request URL]) {
return NPERR_INVALID_URL;
@@ -1187,6 +1188,7 @@ typedef struct {
// Find the frame given the target string.
NSString *target = (NSString *)CFStringCreateWithCString(kCFAllocatorDefault, cTarget, kCFStringEncodingWindowsLatin1);
+ [request HTTPSetReferrer:[[[[[self webFrame] dataSource] request] URL] absoluteString]];
// Make a request, but don't do it right away because it could make the plugin view go away.
WebPluginRequest *pluginRequest = [[WebPluginRequest alloc]
initWithRequest:request frameName:target notifyData:notifyData];
@@ -1202,7 +1204,7 @@ typedef struct {
{
LOG(Plugins, "NPN_GetURLNotify: %s target: %s", URLCString, cTarget);
- NSURLRequest *request = [self requestWithURLCString:URLCString];
+ NSMutableURLRequest *request = [self requestWithURLCString:URLCString];
return [self loadRequest:request inTarget:cTarget withNotifyData:notifyData];
}
@@ -1210,7 +1212,7 @@ typedef struct {
{
LOG(Plugins, "NPN_GetURL: %s target: %s", URLCString, cTarget);
- NSURLRequest *request = [self requestWithURLCString:URLCString];
+ NSMutableURLRequest *request = [self requestWithURLCString:URLCString];
return [self loadRequest:request inTarget:cTarget withNotifyData:NULL];
}
@@ -1265,12 +1267,25 @@ typedef struct {
if (location != NSNotFound) {
// If the blank line is somewhere in the middle of postData, everything before is the header.
NSData *headerData = [postData subdataWithRange:NSMakeRange(0, location)];
- NSDictionary *header = [headerData _web_parseRFC822HeaderFields];
+ NSMutableDictionary *header = [headerData _web_parseRFC822HeaderFields];
+ unsigned dataLength = [postData length] - location;
+
+ // Sometimes plugins like to set Content-Length themselves when they post,
+ // but WebFoundation does not like that. So we will remove the header
+ // and instead truncate the data to the requested length.
+ NSString *contentLength = [header objectForKey:@"Content-Length"];
+
+ if (contentLength != nil) {
+ dataLength = MIN((unsigned)[contentLength intValue], dataLength);
+ }
+ [header removeObjectForKey:@"Content-Length"];
+
if ([header count] > 0) {
[request HTTPSetAllHeaderFields:header];
}
// Everything after the blank line is the actual content of the POST.
- postData = [postData subdataWithRange:NSMakeRange(location, [postData length] - location)];
+ postData = [postData subdataWithRange:NSMakeRange(location, dataLength)];
+
}
}
if ([postData length] == 0) {
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list