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 ...@@ -468,7 +468,7 @@ class App
.addClause('uri', 'one_of', Object.keys(annotator.plugins.Store.entities)) .addClause('uri', 'one_of', Object.keys(annotator.plugins.Store.entities))
.getFilter() .getFilter()
streamerURI = baseURI.replace /\/\w+(\??[^\/]*)\/$/, '/__streamer__' streamerURI = baseURI.replace /\/\w+(\/?\??[^\/]*)\/?$/, '/__streamer__'
$scope.updater = new SockJS streamerURI $scope.updater = new SockJS streamerURI
$scope.updater.onopen = => $scope.updater.onopen = =>
......
...@@ -14,9 +14,7 @@ class Displayer ...@@ -14,9 +14,7 @@ class Displayer
this.$inject = ['$scope','$element','$timeout','baseURI', 'streamfilter'] this.$inject = ['$scope','$element','$timeout','baseURI', 'streamfilter']
constructor: ($scope, $element, $timeout, baseURI, streamfilter) -> constructor: ($scope, $element, $timeout, baseURI, streamfilter) ->
# Set streamer url # Set streamer url
init_path = document.init_path streamerURI = baseURI.replace /\/\w+(\/?\??[^\/]*)\/?$/, '/__streamer__'
@path = baseURI[..-(init_path.toString().length)] + '__streamer__'
delete document.init_path
# Generate client ID # Generate client ID
buffer = new Array(16) buffer = new Array(16)
...@@ -51,7 +49,7 @@ class Displayer ...@@ -51,7 +49,7 @@ class Displayer
to_change.reply_count = reply_count to_change.reply_count = reply_count
$scope.open = => $scope.open = =>
$scope.sock = new SockJS @path $scope.sock = new SockJS streamerURI
$scope.sock.onopen = => $scope.sock.onopen = =>
sockmsg = sockmsg =
......
...@@ -221,7 +221,7 @@ class StreamSearch ...@@ -221,7 +221,7 @@ class StreamSearch
if $scope.sock? then $scope.sock.close() if $scope.sock? then $scope.sock.close()
$scope.annotations = new Array() $scope.annotations = new Array()
streamerURI = baseURI.replace /\/\w+(\??[^\/]*)\/$/, '/__streamer__' streamerURI = baseURI.replace /\/\w+(\/?\??[^\/]*)\/?$/, '/__streamer__'
$scope.sock = new SockJS streamerURI $scope.sock = new SockJS streamerURI
$scope.sock.onopen = => $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