You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by GitBox <gi...@apache.org> on 2019/01/04 06:08:23 UTC

[GitHub] doumafang closed pull request #2004: [iOS] Protect websocket url argument.

doumafang closed pull request #2004: [iOS] Protect websocket url argument.
URL: https://github.com/apache/incubator-weex/pull/2004
 
 
   

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/WeexSDK.podspec b/WeexSDK.podspec
index 2a2b5aa700..694426c3e7 100644
--- a/WeexSDK.podspec
+++ b/WeexSDK.podspec
@@ -87,7 +87,6 @@ Pod::Spec.new do |s|
                           'ios/sdk/WeexSDK/Sources/Manager/WXSDKManager.h',
                           'ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.h',
                           'ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.h',
-                          'ios/sdk/WeexSDK/Sources/Manager/WXDisplayLinkManager.h',
                           'ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.h',
                           'ios/sdk/WeexSDK/Sources/Engine/WXSDKError.h',
                           'ios/sdk/WeexSDK/Sources/Utility/WXConvert.h',
diff --git a/ios/sdk/WeexSDK/Sources/Module/WXWebSocketModule.m b/ios/sdk/WeexSDK/Sources/Module/WXWebSocketModule.m
index c58503f0eb..90c31022cd 100644
--- a/ios/sdk/WeexSDK/Sources/Module/WXWebSocketModule.m
+++ b/ios/sdk/WeexSDK/Sources/Module/WXWebSocketModule.m
@@ -49,6 +49,17 @@ @implementation WXWebSocketModule
 
 - (void)WebSocket:(NSString *)url protocol:(NSString *)protocol
 {
+    // check url
+    NSURL* theURL = [NSURL URLWithString:url];
+    if (theURL == nil) {
+        return;
+    }
+    NSString *scheme = theURL.scheme.lowercaseString;
+    if (!([scheme isEqualToString:@"ws"] || [scheme isEqualToString:@"http"] ||
+          [scheme isEqualToString:@"wss"] || [scheme isEqualToString:@"https"])) {
+        return;
+    }
+    
     if(loader)
     {
         [loader clear];
diff --git a/ios/sdk/WeexSDK/Sources/Performance/WXApmForInstance.m b/ios/sdk/WeexSDK/Sources/Performance/WXApmForInstance.m
index 7a8822dcd0..8da5386c78 100644
--- a/ios/sdk/WeexSDK/Sources/Performance/WXApmForInstance.m
+++ b/ios/sdk/WeexSDK/Sources/Performance/WXApmForInstance.m
@@ -276,7 +276,7 @@ - (void) startRecord:(NSString*) instanceId
     [self updateDiffStats:KEY_PAGE_STATS_IMG_UN_RECYCLE_NUM withDiffValue:0];
 }
 
-- (void) endRecord;
+- (void) endRecord
 {
     if (_isEnd) {
         return;


 

----------------------------------------------------------------
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