From bc768406168b2534edcaca6ce00c342e60c3bde1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 27 Dec 2016 16:20:18 +0200 Subject: [PATCH] test --- iguana/iguana_rpc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/iguana_rpc.c b/iguana/iguana_rpc.c index b3d7cb8f1..70c072490 100755 --- a/iguana/iguana_rpc.c +++ b/iguana/iguana_rpc.c @@ -868,9 +868,11 @@ char *SuperNET_rpcparse(struct supernet_info *myinfo,char *retbuf,int32_t bufsiz originstr = &urlstr[i + strlen(fieldstr)]; if ( strncmp(originstr,"http://127.0.0.",strlen("http://127.0.0.")) == 0 ) originstr = "http://127.0.0.1:"; - if ( strncmp(originstr,"file://127.0.0.",strlen("file://127.0.0.")) == 0 ) + else if ( strncmp(originstr,"file://127.0.0.",strlen("file://127.0.0.")) == 0 ) originstr = "http://127.0.0.1:"; - if ( strncmp("null",originstr,strlen("null")) != 0 && strncmp("http://localhost:",originstr,strlen("http://localhost:")) != 0 && strncmp("http://127.0.0.1:",originstr,strlen("http://127.0.0.1:")) != 0 && strncmp("http://easydex.supernet.org",originstr,strlen("http://easydex.supernet.org")) != 0 ) + else if ( strncmp(originstr,"chrome-extension://",strlen("chrome-extension://")) == 0 ) + originstr = "http://127.0.0.1:"; + else if ( strncmp("null",originstr,strlen("null")) != 0 && strncmp("http://localhost:",originstr,strlen("http://localhost:")) != 0 && strncmp("http://127.0.0.1:",originstr,strlen("http://127.0.0.1:")) != 0 && strncmp("http://easydex.supernet.org",originstr,strlen("http://easydex.supernet.org")) != 0 ) { printf("remote %s REJECT.(%s)\n",fieldstr,urlstr); return(clonestr("{\"error\":\"remote origin not enabled\"}"));