Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
[iOS] Protect stream module arguments. (#1619)
Browse files Browse the repository at this point in the history
  • Loading branch information
wqyfavor authored and cxfeng1 committed Oct 8, 2018
1 parent 5cbf24b commit 875a5eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 1 addition & 2 deletions ios/sdk/WeexSDK/Sources/Handler/WXURLRewriteDefaultImpl.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
#import "WXLog.h"
#import "WXSDKInstance.h"


NSString *const WXURLLocalScheme = @"local";
static NSString *const WXURLLocalScheme = @"local";

@implementation WXURLRewriteDefaultImpl

Expand Down
8 changes: 8 additions & 0 deletions ios/sdk/WeexSDK/Sources/Module/WXStreamModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 875a5eb

Please sign in to comment.