Skip to content

Commit 8f5c560

Browse files
committed
refactor: Refactored RequestMethodString function to follow developer notes
Removed the default case in the switch statement in order to comply with the Developer Notes
1 parent 7fd3b94 commit 8f5c560

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/httpserver.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,10 @@ std::string RequestMethodString(HTTPRequest::RequestMethod m)
198198
return "HEAD";
199199
case HTTPRequest::PUT:
200200
return "PUT";
201-
default:
201+
case HTTPRequest::UNKNOWN:
202202
return "unknown";
203-
}
203+
} // no default case, so the compiler can warn about missing cases
204+
assert(false);
204205
}
205206

206207
/** HTTP request callback */

0 commit comments

Comments
 (0)