mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-27 15:30:42 +00:00
Don't pass protocol-relative URLs to the Ace worker
Bug: T271487 Change-Id: Ib344e7c021f9224f08c0c844d4e96e5bede356c8
This commit is contained in:
parent
a9a8675d81
commit
b9efb9ec7d
|
@ -123,13 +123,16 @@ ace.define( 'ace/mode/abusefilter', [ 'require', 'exports', 'module', 'ace/lib/o
|
|||
|
||||
this.createWorker = function ( session ) {
|
||||
var extPath = mw.config.get( 'wgExtensionAssetsPath' ),
|
||||
worker;
|
||||
worker,
|
||||
apiPath;
|
||||
ace.config.set( 'workerPath', extPath + '/AbuseFilter/modules' );
|
||||
worker = new WorkerClient( [ 'ace' ], 'ace/mode/abusefilter_worker', 'AbuseFilterWorker' );
|
||||
|
||||
worker.$worker.postMessage( {
|
||||
apipath: mw.config.get( 'wgServer' ) + new mw.Api().defaults.ajax.url
|
||||
} );
|
||||
apiPath = mw.config.get( 'wgServer' ) + new mw.Api().defaults.ajax.url;
|
||||
if ( apiPath.substr( 0, 2 ) === '//' ) {
|
||||
apiPath = window.location.protocol + apiPath;
|
||||
}
|
||||
worker.$worker.postMessage( { apipath: apiPath } );
|
||||
|
||||
worker.attachToDocument( session.getDocument() );
|
||||
|
||||
|
|
Loading…
Reference in a new issue