-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve
from
search prefix error handling (#37)
* Make `from` search prefix more robust (addresses mastodon/mastodon#17941) * Improve robustness for account string validation Using unsupported prefixes now reports a 422; searching for posts from an account the instance is not aware of reports a 404. TODO: The UI for this on the front end is abysmal. Searching `from:username@domain` now succeeds when `domain` is the local domain; searching `from:@username(@Domain)?` now works as expected. * Satisfy upstream rubcocp * Unbreak upstream tests * Make account string validation consistent with mention processing We previously matched on one-character domains and domains ending with `[\.-]`, allowing `from:@A@a` and `from:@A@a-` searches to cause an account lookup. This commit will raise a syntax error in both cases, as MENTION_RE would never match them. * Refactor `from` prefix error handling. Incorporates changes suggested in #37. In doing so, adopts an error handling style more consistent with the existing codebase (for which I must thank @ClearlyClaire). Removes new code no longer in use.
- Loading branch information
Showing
4 changed files
with
40 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters