@@ -28,17 +28,14 @@ HTTPRequest::HTTPRequest(std::string const& sData) : HTTPMessage(sData) {
2828HTTPRequest::HTTPRequest (byte* pData, unsigned int len) : HTTPMessage(pData, len) {
2929}
3030
31- HTTPRequest::~HTTPRequest () {
32- }
33-
3431/* *
3532 * Takes the method name and converts it to the corresponding method
3633 * id detailed in the Method enum
3734 *
3835 * @param name String representation of the Method
3936 * @return Corresponding Method ID, -1 if unable to find the method
4037 */
41- int HTTPRequest::methodStrToInt (std::string_view name) {
38+ int HTTPRequest::methodStrToInt (std::string_view name) const {
4239 // Method name cannot must be between 1 and 10 characters. Anything outside those bounds shouldn't be compared at all
4340 if (name.empty () || (name.size () >= 10 ))
4441 return -1 ;
@@ -59,7 +56,7 @@ int HTTPRequest::methodStrToInt(std::string_view name) {
5956 * @param mid Method ID to lookup
6057 * @return The method name in the from of a std::string. Blank if unable to find the method
6158 */
62- std::string HTTPRequest::methodIntToStr (unsigned int mid) {
59+ std::string HTTPRequest::methodIntToStr (unsigned int mid) const {
6360 // ID is out of bounds of the possible requestMethodStr indexes
6461 if (mid >= NUM_METHODS)
6562 return " " ;
@@ -110,7 +107,8 @@ byte* HTTPRequest::create() {
110107 * @param True if successful. If false, sets parseErrorStr for reason of failure
111108 */
112109bool HTTPRequest::parse () {
113- std::string initial = " " , methodName = " " ;
110+ std::string initial = " " ;
111+ std::string methodName = " " ;
114112
115113 // Get elements from the initial line: <method> <path> <version>\r\n
116114 methodName = getStrElement ();
0 commit comments