File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -27,15 +27,28 @@ class RMCore {
27
27
path : string ,
28
28
config : RMConfig
29
29
) {
30
+ let domain = LPConfiguration . server ;
31
+
30
32
if ( path . length === 0 ) {
31
33
path = "/" ;
32
34
}
33
- if ( path . charAt ( 0 ) !== '/' ) {
34
- path = '/' + path ;
35
+
36
+ if ( path . charAt ( 0 ) !== "/" ) {
37
+ if ( path . indexOf ( "http" ) === 0 ) {
38
+ if ( path . indexOf ( "/" , 8 ) === - 1 ) {
39
+ domain = path ;
40
+ path = "" ;
41
+ } else {
42
+ domain = path . substring ( 0 , path . indexOf ( "/" , 8 ) ) ;
43
+ path = path . substring ( path . indexOf ( "/" , 8 ) ) ;
44
+ }
45
+ } else {
46
+ path = "/" + path ;
47
+ }
35
48
}
36
49
37
50
// Generate the url based on the path and the config server url.
38
- this . url = LPConfiguration . server + path ;
51
+ this . url = domain + path ;
39
52
40
53
this . method = method ;
41
54
this . header = {
You can’t perform that action at this time.
0 commit comments