44 *--------------------------------------------------------------------------------------------*/
55'use strict' ;
66
7- import network = require ( 'vs/base/common/network' ) ;
7+ import URI from 'vs/base/common/uri' ;
88import strings = require( 'vs/base/common/strings' ) ;
99import Timer = require( 'vs/base/common/timer' ) ;
1010import Async = require( 'vs/base/common/async' ) ;
@@ -46,7 +46,7 @@ export class BaseRequestService implements IRequestService {
4646
4747 // Find root server URL from configuration
4848 this . _origin = workspaceUri ;
49- var urlPath = new network . URL ( this . _origin ) . getPath ( ) ;
49+ var urlPath = URI . parse ( this . _origin ) . path ;
5050 if ( urlPath && urlPath . length > 0 ) {
5151 this . _origin = this . _origin . substring ( 0 , this . _origin . length - urlPath . length + 1 ) ;
5252 }
@@ -59,44 +59,6 @@ export class BaseRequestService implements IRequestService {
5959 }
6060 }
6161
62- public getRequestUrl ( service :string , path ?:string , absolute ?:boolean ) :string {
63- if ( this . _serviceMap [ service ] ) {
64- var serviceUrl = this . _serviceMap [ service ] + strings . normalizePath ( path ) ;
65-
66- var fullUrl = new network . URL ( serviceUrl ) ;
67- if ( fullUrl . getScheme ( ) ) {
68- return serviceUrl ;
69- }
70-
71- // request URL relative to server
72- if ( ! absolute ) {
73- return serviceUrl ;
74- }
75-
76- // absolute request URL
77- return this . _origin + strings . ltrim ( serviceUrl , '/' ) ;
78- }
79-
80- return null ;
81- }
82-
83- public getPath ( service :string , requestUrl :network . URL ) :string {
84-
85- // Find service root
86- var serviceRoot = this . getRequestUrl ( service , '/' , true ) ;
87- if ( ! serviceRoot ) {
88- return null ;
89- }
90-
91- // Substr path
92- var index = requestUrl . toString ( ) . indexOf ( serviceRoot ) ;
93- if ( index === 0 ) {
94- return requestUrl . toString ( ) . substr ( serviceRoot . length - 1 ) ; // Keep leading slash
95- }
96-
97- return null ;
98- }
99-
10062 protected makeCrossOriginRequest ( options :http . IXHROptions ) : winjs . TPromise < http . IXHRResponse > {
10163 return null ;
10264 }
0 commit comments