Commit c3fd3c14 authored by jan.koester's avatar jan.koester
Browse files

cookie parse now throw if cookies are not set

parent 9f6cb773
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1369,8 +1369,11 @@ void libhttppp::HttpCookie::setcookie(HttpResponse *curresp,
void libhttppp::HttpCookie::parse(libhttppp::HttpRequest* curreq){
  HttpHeader::HeaderData *hc = curreq->getData("cookie");

  if(!hc)
    return;
  if(!hc){
        HTTPException httpexception;
        httpexception[HTTPException::Note] << "no cookies are set!";
        throw httpexception;
  }

  std::vector<char> cdat;
  std::copy(curreq->getData(hc),curreq->getData(hc)+strlen(curreq->getData(hc)),