Commit c8e523f1 authored by Robert Knight's avatar Robert Knight

Consistently include a trailing slash in the API root URL

Some API URLs are created by resolving relative URLs against the API
root. For this to work properly, the root URL has to include a trailing
slash.

The omission of this in the documentation caused confusion for eLife
devs.
parent 7f1e42f7
...@@ -102,7 +102,7 @@ loads. ...@@ -102,7 +102,7 @@ loads.
window.hypothesisConfig = function () { window.hypothesisConfig = function () {
return { return {
services: [{ services: [{
apiUrl: 'https://hypothes.is/api', apiUrl: 'https://hypothes.is/api/',
authority: 'partner.org', authority: 'partner.org',
grantToken: '***', grantToken: '***',
icon: 'https://openclipart.org/download/272629/sihouette-animaux-10.svg' icon: 'https://openclipart.org/download/272629/sihouette-animaux-10.svg'
......
...@@ -39,7 +39,7 @@ describe('hostPageConfig', function () { ...@@ -39,7 +39,7 @@ describe('hostPageConfig', function () {
it('ignores non-whitelisted config params', function () { it('ignores non-whitelisted config params', function () {
var window_ = fakeWindow({ var window_ = fakeWindow({
apiUrl: 'https://not-the-hypothesis/api', apiUrl: 'https://not-the-hypothesis/api/',
}); });
assert.deepEqual(hostPageConfig(window_), {}); assert.deepEqual(hostPageConfig(window_), {});
......
...@@ -29,7 +29,7 @@ describe('store', function () { ...@@ -29,7 +29,7 @@ describe('store', function () {
angular.mock.module('h', { angular.mock.module('h', {
auth: fakeAuth, auth: fakeAuth,
settings: {apiUrl: 'http://example.com/api'}, settings: {apiUrl: 'http://example.com/api/'},
}); });
angular.mock.inject(function (_$q_) { angular.mock.inject(function (_$q_) {
...@@ -50,7 +50,7 @@ describe('store', function () { ...@@ -50,7 +50,7 @@ describe('store', function () {
$httpBackend = _$httpBackend_; $httpBackend = _$httpBackend_;
store = _store_; store = _store_;
$httpBackend.expectGET('http://example.com/api').respond({ $httpBackend.expectGET('http://example.com/api/').respond({
// Return an API route directory. // Return an API route directory.
// This should mirror the structure (but not the exact URLs) of // This should mirror the structure (but not the exact URLs) of
// https://hypothes.is/api/. // https://hypothes.is/api/.
......
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