10000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b991a1d commit b74358bCopy full SHA for b74358b
lib/server.js
@@ -1,6 +1,7 @@
1
'use strict';
2
3
const events = require('events');
4
+const url = require('url');
5
const debug = require('debug')('sockjs:server');
6
const listener = require('./listener');
7
const webjs = require('./webjs');
@@ -41,7 +42,7 @@ class Server extends events.EventEmitter {
41
42
if (this.options.prefix) {
43
// remove trailing slash, but not leading
44
this.options.prefix = this.options.prefix.replace(/\/$/, '');
- this._prefixMatches = (url) => url.startsWith(this.options.prefix);
45
+ this._prefixMatches = (requrl) => url.parse(requrl).pathname.startsWith(this.options.prefix);
46
}
47
48
this.options.log('debug', `SockJS v${pkg.version} bound to ${JSON.stringify(this.options.prefix)}`);
0 commit comments