mirror of
https://github.com/HeyPuter/puter
synced 2024-11-14 22:06:00 +00:00
fix: fix 500 when check-app has bad url
This commit is contained in:
parent
d8dc3ac122
commit
9a622004ea
@ -482,6 +482,10 @@ module.exports = class APIError {
|
|||||||
status: 422,
|
status: 422,
|
||||||
message: 'This share can not be applied to this user.',
|
message: 'This share can not be applied to this user.',
|
||||||
},
|
},
|
||||||
|
'no_origin_for_app': {
|
||||||
|
status: 400,
|
||||||
|
message: 'Puter apps must have a valid URL.'
|
||||||
|
},
|
||||||
|
|
||||||
// Chat
|
// Chat
|
||||||
// TODO: specifying these errors here might be a violation
|
// TODO: specifying these errors here might be a violation
|
||||||
|
@ -442,6 +442,9 @@ class AuthService extends BaseService {
|
|||||||
|
|
||||||
async app_uid_from_origin (origin) {
|
async app_uid_from_origin (origin) {
|
||||||
origin = this._origin_from_url(origin);
|
origin = this._origin_from_url(origin);
|
||||||
|
if ( origin === null ) {
|
||||||
|
throw APIError.create('no_origin_for_app');
|
||||||
|
}
|
||||||
return await this._app_uid_from_origin(origin);
|
return await this._app_uid_from_origin(origin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user