summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--icespider/core/ihttpRequest.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/icespider/core/ihttpRequest.cpp b/icespider/core/ihttpRequest.cpp
index 97cdcd7..c575c82 100644
--- a/icespider/core/ihttpRequest.cpp
+++ b/icespider/core/ihttpRequest.cpp
@@ -114,6 +114,12 @@ namespace IceSpider {
if (acceptHdr) {
auto accepts = parseAccept(*acceptHdr);
auto & strm = getOutputStream();
+ if (accepts.empty()) {
+ throw Http400_BadRequest();
+ }
+ if (!accepts.front().group && !accepts.front().type) {
+ return handler->defaultSerializer(strm);
+ }
for (auto & a : accepts) {
ContentTypeSerializer serializer = handler->getSerializer(a, strm);
if (serializer.second) {