Slashes in permissions API

Ali Afshar avatarAli Afshar created an issue
17:45 < terrycojones> aa_: fom seems to be putting an extra / in its requests for permissions, using e.g., 
                      fom.api.FluidApi(db).permissions.tag_values[path].get('READ')
17:46 < terrycojones> aa_: i get a 404 error and the fluiddb log shows a request for //permissions/tag-values/.....
17:49 < terrycojones> aa_: actually, root_path is unused in ItemPermissionsApi in api.py
17:50 < terrycojones> aa_: ah, i see why that's the case (sorry).
18:01 < terrycojones> aa_: ok, i found the problem:  if you pass a base URL to the Fluid() __init__ that ends with a slash, you get a doubled 
                      slash in requests. I know that's my fault (txFluiddb expects a slash, in contrast), but it would be nice to have 
                      __init__ check for baseURL.endswith('/') or maybe just an assert not endswith so the unsuspecting fom user doesn't have 
                      to go digging as i just did :-)

Comments (3)

  1. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.