Skip to content

Commit 7cb0120

Browse files
authored
Add 401 and method to add more
1 parent 9c19a27 commit 7cb0120

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

AndroidAsync/src/com/koushikdutta/async/http/server/AsyncHttpServer.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ public CompletedCallback getErrorCallback() {
330330
mCodes.put(302, "Found");
331331
mCodes.put(304, "Not Modified");
332332
mCodes.put(400, "Bad Request");
333+
mCodes.put(401, "Unauthorized");
333334
mCodes.put(404, "Not Found");
334335
mCodes.put(500, "Internal Server Error");
335336
}
@@ -341,6 +342,10 @@ public static String getResponseCodeDescription(int code) {
341342
return d;
342343
}
343344

345+
public static void addResponseCodeDescription( int code, String description ) {
346+
mCodes.put(code, description);
347+
}
348+
344349
public static interface WebSocketRequestCallback {
345350
void onConnected(WebSocket webSocket, AsyncHttpServerRequest request);
346351
}

0 commit comments

Comments
 (0)