sipcapture / homer-app

HOMER 7.x Front-End and API Server
http://sipcapture.io
GNU Affero General Public License v3.0
204 stars 79 forks source link

API: Adding alias of >40 chars fails but returns 201 Created #505

Closed vaizki closed 2 days ago

vaizki commented 1 year ago

Using the API to add an alias, I accidentally had an alias longer than 40 chars (which is the max len in the DB). The API returns 201 Created but the response body is an empty string instead of the expected json object representing the inserted alias.

This is clearly because there is no typical "err" value returned by the AliasService.Add and the objrct value is not checked in the alias controller:

https://github.com/sipcapture/homer-app/blob/master/controller/v1/alias.go#L63

vaizki commented 1 year ago

Also now noticed that in the GUI, the input validation is max 24 characters for alias which is inconsistent with the 40 char max in DB.

adubovikov commented 1 year ago

https://github.com/sipcapture/homer-app/commit/7e145e70d49ee368d8d59a464395a008359cf1de

250 chars should be ok now :-)

@RFbkak37y3kIY @AlexeyOplachko please remove the limit in UI

adubovikov commented 2 days ago

we extended to 250 chars.

https://github.com/sipcapture/homer-app/blob/master/model/alias.go#L19