HTTP bridge baseurl weirdness

#1

My router config for the HTTP bridge has a baseurl that looks like this:

http://some.example.com/api/v1/accounts

To access a specific account, I need to append an extra component to the path like this:

http://some.example.com/api/v1/accounts/10

In order to do that, I specify the last part of the path in the call to autobahn:

call(…, { url: ‘10’ }, …)

However, when I do this get a 404 error from my server that says the following cannot be found:

http://some.example.com/api/v1/10

In other words, it appears that the code in crossbar that is concatenating the paths together is dropping the last part of the path, in this case the word ‘accounts’.

If I put a trailing slash in the base url, then the concatenation works like I would expect; However, in my particular case I can’t have a trailing slash in my baseurl because sometimes I need to be able to access the endpoint without it, i.e:

http://some.example.com/api/v1/accounts?search=username

Any ideas why this is happening? I’ve done several experiments to try and nail down the exact behavior and so far I’m pretty confused.

– Talin

0 Likes