Commit bae64b05 authored by Randall Leeds's avatar Randall Leeds

Catch trailing / before query building streamer

Closes #1086
parent 53d686d9
......@@ -468,7 +468,7 @@ class App
.addClause('uri', 'one_of', Object.keys(annotator.plugins.Store.entities))
.getFilter()
streamerURI = baseURI.replace /\/\w+(\??[^\/]*)\/$/, '/__streamer__'
streamerURI = baseURI.replace /\/\w+(\/?\??[^\/]*)\/?$/, '/__streamer__'
$scope.updater = new SockJS streamerURI
$scope.updater.onopen = =>
......
......@@ -14,9 +14,7 @@ class Displayer
this.$inject = ['$scope','$element','$timeout','baseURI', 'streamfilter']
constructor: ($scope, $element, $timeout, baseURI, streamfilter) ->
# Set streamer url
init_path = document.init_path
@path = baseURI[..-(init_path.toString().length)] + '__streamer__'
delete document.init_path
streamerURI = baseURI.replace /\/\w+(\/?\??[^\/]*)\/?$/, '/__streamer__'
# Generate client ID
buffer = new Array(16)
......@@ -51,7 +49,7 @@ class Displayer
to_change.reply_count = reply_count
$scope.open = =>
$scope.sock = new SockJS @path
$scope.sock = new SockJS streamerURI
$scope.sock.onopen = =>
sockmsg =
......
......@@ -221,7 +221,7 @@ class StreamSearch
if $scope.sock? then $scope.sock.close()
$scope.annotations = new Array()
streamerURI = baseURI.replace /\/\w+(\??[^\/]*)\/$/, '/__streamer__'
streamerURI = baseURI.replace /\/\w+(\/?\??[^\/]*)\/?$/, '/__streamer__'
$scope.sock = new SockJS streamerURI
$scope.sock.onopen = =>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment