caronc / apprise-api

A lightweight REST framework that wraps the Apprise Notification Library
https://hub.docker.com/r/caronc/apprise
MIT License
638 stars 56 forks source link

Bug with tags with apprise cli #107

Closed killbus closed 1 year ago

killbus commented 1 year ago

:beetle: Describe the bug

cli

apprise -b "test" 'apprise://localhost:8000/apprise?tags=tgtxt&+X-Apprise-Log-Level=DEBUG' -vvv

it raised:

   File "/app/apprise-api/apprise_api/./api/views.py", line 623, in post
apprise-api_1  |     if not TAG_VALIDATION_RE.match(content.get('tag')):
apprise-api_1  | TypeError: expected string or bytes-like object

:bulb: Screenshots and Logs

:computer: Your System Details:

:crystal_ball: Additional context

I added print(content) for debug, it showed: {'title': '', 'body': 'test', 'type': 'info', 'format': 'text', 'tag': ['tgtxt']}

The content.get('tag') as a list ['tgtxt'] will not pass the validation:

https://github.com/caronc/apprise-api/blob/master/apprise_api/api/views.py#L622

maybe this is the bug related to apprise instead?

https://github.com/caronc/apprise/blob/20571075904ad0d60124f173a5e235f8d98ba583/apprise/plugins/NotifyAppriseAPI.py#LL231C31-L231C31

        if self.__tags:
            payload['tag'] = self.__tags

to

        if self.__tags:
            payload['tag'] = ','.join([x for x in self.__tags])
pushc6 commented 1 year ago

@killbus @caronc I think I may be experiencing this as well, it's resulting in none of my apprise:// calls working because I use the ?tags parameter. Even passing a single parameter, I get:

File "/app/apprise-api/apprise_api/./api/views.py", line 622, in post if not TAG_VALIDATION_RE.match(content.get('tag')): TypeError: expected string or bytes-like object

Calling apprise via apprise://localhost:8000/apprise?tags=tagname

caronc commented 1 year ago

This was fixed a release or so ago, but i noticed the ticket is still open. Can you guys confirm if you're still having the problem as it seems to work fine for me.

caronc commented 1 year ago

I'm closing this off presuming your issue has gone away and the lack of response.