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").
f='#n119'>119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196