Skip to content
This repository has been archived by the owner on May 1, 2019. It is now read-only.

400 on GET objects/[object] #37

Closed
mswaidan opened this issue Apr 3, 2018 · 3 comments
Closed

400 on GET objects/[object] #37

mswaidan opened this issue Apr 3, 2018 · 3 comments
Assignees
Labels

Comments

@mswaidan
Copy link
Collaborator

mswaidan commented Apr 3, 2018

e.g. when URL is http://104.131.39.3:8080/?server=http://104.131.39.3:3000 we get the error GET http://104.131.39.3:3000/api/v1/objects/5a7b1acc6834136c23c73ea0?omit=base64,rawData 400 (Bad Request)

User login & stream lists work as expected

@mswaidan mswaidan added the bug label Apr 3, 2018
@mswaidan mswaidan self-assigned this Apr 3, 2018
@mswaidan mswaidan changed the title Setting server address as URL param doesn't affect where viewer is looking for objects 400 on GET objects/[object] Apr 3, 2018
@mswaidan
Copy link
Collaborator Author

mswaidan commented Apr 3, 2018

Server error:

2018-04-03T02:15:32.769Z - info: HTTP GET /api/v1/objects/5a7b1acc6834136c23c73ea0 400
debug: checking perms false | guest |
error:  TypeError: Cannot read property 'toString' of undefined
    at Promise (/root/SpeckleServer/app/api/v1/middleware/PermissionCheck.js:20:75)
    at new Promise (<anonymous>)
    at module.exports (/root/SpeckleServer/app/api/v1/middleware/PermissionCheck.js:12:10)
    at SpeckleObject.findOne.then.object (/root/SpeckleServer/app/api/v1/objects/ObjectGet.js:16:22)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)```

@mswaidan
Copy link
Collaborator Author

mswaidan commented Apr 3, 2018

Objects created on old api don't have 'owner' property, so perm check fails.

@mswaidan mswaidan closed this as completed Apr 3, 2018
@didimitrie
Copy link
Member

Yes, i'm afraid this is not gonna be backwards compatible unless i introduce a big risky thing (treat resources with no owner as public)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants