Skip to content

Commit

Permalink
MS Teams url parsing token encoding support (#438)
Browse files Browse the repository at this point in the history
  • Loading branch information
caronc authored Sep 7, 2021
1 parent 1916a91 commit e0f928f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions apprise/plugins/NotifyMSTeams.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class NotifyMSTeams(NotifyBase):
'type': 'string',
'private': True,
'required': True,
'regex': (r'^[A-Za-z0-9]+$', 'i'),
'regex': (r'^[a-z0-9]+$', 'i'),
},
# Token required as part of the API request
# /........./........./CCCCCCCCCCCCCCCCCCCCCCCC
Expand All @@ -177,7 +177,7 @@ class NotifyMSTeams(NotifyBase):
'type': 'string',
'private': True,
'required': True,
'regex': (r'^[A-Z0-9-]+$', 'i'),
'regex': (r'^[a-z0-9-]+$', 'i'),
},
})

Expand Down Expand Up @@ -539,10 +539,13 @@ def parse_url(url):
results['team'] = NotifyMSTeams.unquote(results['host'])

# Get the token from the path
results['token_a'] = None if not entries else entries.pop(0)
results['token_a'] = None if not entries \
else NotifyMSTeams.unquote(entries.pop(0))

results['token_b'] = None if not entries else entries.pop(0)
results['token_c'] = None if not entries else entries.pop(0)
results['token_b'] = None if not entries \
else NotifyMSTeams.unquote(entries.pop(0))
results['token_c'] = None if not entries \
else NotifyMSTeams.unquote(entries.pop(0))

# Get Image
results['include_image'] = \
Expand Down

0 comments on commit e0f928f

Please sign in to comment.