summary refs log tree commit diff stats
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go17
1 files changed, 16 insertions, 1 deletions
diff --git a/main.go b/main.go
index 61acb42..43c204b 100644
--- a/main.go
+++ b/main.go
@@ -51,12 +51,27 @@ func main() {
 		Methods("GET").
 		HandlerFunc(apiEndpointHandler)
 
-	// This is for submitting new users
+	// This is for submitting new users. Both query variables must exist
+	// in the request for this to match.
 	api.Path("/{format:(?:plain)}/{endpoint:users}").
 		Queries("url", "{url}", "nickname", "{nickname:[a-zA-Z0-9_-]+}").
 		Methods("POST").
 		HandlerFunc(apiEndpointPOSTHandler)
 
+	// This is for submitting new users incorrectly
+	// and letting the requester know about their error.
+	api.Path("/{format:(?:plain)}/{endpoint:users}").
+		Queries("url", "{url}").
+		Methods("POST").
+		HandlerFunc(apiEndpointPOSTHandler)
+
+	// This is for submitting new users incorrectly
+	// and letting the requester know about their error.
+	api.Path("/{format:(?:plain)}/{endpoint:users}").
+		Queries("nickname", "{nickname:[a-zA-Z0-9_-]+}").
+		Methods("POST").
+		HandlerFunc(apiEndpointPOSTHandler)
+
 	// Show all observed tags
 	api.Path("/{format:(?:plain)}/tags").
 		Methods("GET").