[PR #1082] [MERGED] Fix username regex #1510

Closed
opened 2026-05-07 01:02:26 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/binwiederhier/ntfy/pull/1082
Author: @wunter8
Created: 4/4/2024
Status: Merged
Merged: 4/24/2024
Merged by: @binwiederhier

Base: mainHead: fix-username-regex


📝 Commits (4)

  • e4d22eb allow + in usernames
  • fc7cf59 fix error message for invalid username/password
  • e4c2b93 clean up invalid username code
  • 4111bee fix linting issue

📊 Changes

4 files changed (+18 additions, -1 deletions)

View changed files

📝 server/errors.go (+1 -0)
📝 server/server_account.go (+4 -0)
📝 user/types.go (+1 -1)
📝 user/types_test.go (+12 -0)

📄 Description

Now you can include a "+" in your username (for example, in an email alias).

I also added some code to convert the user/types.go ErrInvalidArgument into an errHTTPBadRequestInvalidArgument so that the error message in the web UI says "invalid request: invalid argument" instead of "internal server error."

I feel like that part of the PR isn't super clean, so you might want to rewrite it (all 6 lines)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/binwiederhier/ntfy/pull/1082 **Author:** [@wunter8](https://github.com/wunter8) **Created:** 4/4/2024 **Status:** ✅ Merged **Merged:** 4/24/2024 **Merged by:** [@binwiederhier](https://github.com/binwiederhier) **Base:** `main` ← **Head:** `fix-username-regex` --- ### 📝 Commits (4) - [`e4d22eb`](https://github.com/binwiederhier/ntfy/commit/e4d22ebd8b113eb23964e6344e213dbc5c5ce2ea) allow + in usernames - [`fc7cf59`](https://github.com/binwiederhier/ntfy/commit/fc7cf5933facc55d1e68fc6bac16205bfc72982b) fix error message for invalid username/password - [`e4c2b93`](https://github.com/binwiederhier/ntfy/commit/e4c2b938d3465f6400e5cbd53a96da1f84d4fa6a) clean up invalid username code - [`4111bee`](https://github.com/binwiederhier/ntfy/commit/4111bee0c433d158d7a93a2b0d895e24b9395f42) fix linting issue ### 📊 Changes **4 files changed** (+18 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `server/errors.go` (+1 -0) 📝 `server/server_account.go` (+4 -0) 📝 `user/types.go` (+1 -1) 📝 `user/types_test.go` (+12 -0) </details> ### 📄 Description Now you can include a "+" in your username (for example, in an email alias). I also added some code to convert the user/types.go ErrInvalidArgument into an errHTTPBadRequestInvalidArgument so that the error message in the web UI says "invalid request: invalid argument" instead of "internal server error." I feel like that part of the PR isn't super clean, so you might want to rewrite it (all 6 lines) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-07 01:02:26 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#1510
No description provided.