#include "handler.ih"

void Handler::saveZipFile()
{
    string line;

    while (getline(cin, line))
    {
        if (
            line.find("Content-Disposition: attachment;") != string::npos
//            or
//            line.find("Content-Type: application/zip") != string::npos
//            or
//            line.find("Content-Type: application/x-zip-compressed") != 
//                                                          string::npos
        )
        {
            saveZip(line);
            return;
        }
    }

    throw Exception{REPLY} << "cannot find Content-Type: application/zip";
}



