You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@weex.apache.org by GitBox <gi...@apache.org> on 2018/10/08 06:37:37 UTC

[GitHub] cxfeng1 closed pull request #1619: [iOS] Protect stream module arguments.

cxfeng1 closed pull request #1619: [iOS] Protect stream module arguments.
URL: https://github.com/apache/incubator-weex/pull/1619
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/ios/sdk/WeexSDK/Sources/Handler/WXURLRewriteDefaultImpl.m b/ios/sdk/WeexSDK/Sources/Handler/WXURLRewriteDefaultImpl.m
index bcd7215fd0..7f7d08f273 100644
--- a/ios/sdk/WeexSDK/Sources/Handler/WXURLRewriteDefaultImpl.m
+++ b/ios/sdk/WeexSDK/Sources/Handler/WXURLRewriteDefaultImpl.m
@@ -21,8 +21,7 @@
 #import "WXLog.h"
 #import "WXSDKInstance.h"
 
-
-NSString *const WXURLLocalScheme = @"local";
+static NSString *const WXURLLocalScheme = @"local";
 
 @implementation WXURLRewriteDefaultImpl
 
diff --git a/ios/sdk/WeexSDK/Sources/Module/WXStreamModule.m b/ios/sdk/WeexSDK/Sources/Module/WXStreamModule.m
index abbbb50035..fa1e303e31 100644
--- a/ios/sdk/WeexSDK/Sources/Module/WXStreamModule.m
+++ b/ios/sdk/WeexSDK/Sources/Module/WXStreamModule.m
@@ -119,6 +119,14 @@ - (WXResourceRequest*)_buildRequestWithOptions:(NSDictionary*)options callbackRs
 {
     // parse request url
     NSString *urlStr = [options objectForKey:@"url"];
+    if (![urlStr isKindOfClass:[NSString class]]) {
+        if (callbackRsp) {
+            [callbackRsp setObject:@(-1) forKey:@"status"];
+            [callbackRsp setObject:@NO forKey:@"ok"];
+        }
+        return nil;
+    }
+    
     NSString *newURL = [urlStr copy];
     WX_REWRITE_URL(urlStr, WXResourceTypeLink, self.weexInstance)
     urlStr = newURL;


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services