restangular icon indicating copy to clipboard operation
restangular copied to clipboard

Keep track of baseUrl root path and handle path-absolute resources.

Open aivins opened this issue 11 years ago • 3 comments

This is related to issue #620.

API endpoint returns a path-absolute self link, such as /api/v1/person/5.

baseUrl setting includes part of this path, such as http://some.host:8000/api/v1/. baseUrlRoot will be set to http://some.host:8000.

If setSelfLinkAbsoluteUrl is not true, then a second check will happen to see if the self link begins with a slash. If so it is treated as path-relative and appended to baseUrlRoot.

This covers my own issues with self links cross domain as well as the path-absolute issues touched upon in #620.

aivins avatar Aug 21 '14 04:08 aivins

@aivins, would that work when the self link is relative to the API root? e.g. /person/5 instead of /api/v1/person/5 where baseUrl is /api. I've found that python-eve is moving into that direction (nicolaiarocci/eve@69b8141c0c5f10e8d4221e56228a80cb0bc92bd6), which makes sense to me. See also #665.

sevein avatar Oct 10 '14 19:10 sevein

I think this should be good; I need to read it again and test it more thoroughly. A couple items tho:

  • [ ] Can you rebase on master please?
  • [ ] And…can you please add some tests?

daviesgeek avatar Jun 16 '16 21:06 daviesgeek

Any chance of this getting merged anytime soon? I'm seeing quite a few open issues relating to this.

bostrom avatar Oct 14 '16 13:10 bostrom