Accept zero length queries

This commit is contained in:
Alex Hultman
2023-04-30 22:30:06 +02:00
parent e5b1d3f83c
commit a658d1616a
3 changed files with 23 additions and 1 deletions
+20
View File
@@ -0,0 +1,20 @@
#include <iostream>
#include <cassert>
#include "../src/QueryParser.h"
int main() {
{
std::string buf = "?test1=&test2=someValue";
assert(uWS::getDecodedQueryValue("test2", (char *) buf.data()) == "someValue");
}
{
std::string buf = "?test1=&test2=someValue";
assert(uWS::getDecodedQueryValue("test1", (char *) buf.data()) == "");
assert(uWS::getDecodedQueryValue("test2", (char *) buf.data()) == "someValue");
}
return 0;
}