diff --git a/server.py b/server.py index b52e990..35ce921 100644 --- a/server.py +++ b/server.py @@ -2,7 +2,7 @@ import asyncio, traceback, socket, ssl, zipfile, random, string, io from OpenSSL import crypto from urllib.parse import urlparse, quote -from flask import Flask, request, redirect, send_file, Response +from flask import Flask, request, redirect, send_file, Response make_response from hypercorn.config import Config from hypercorn.asyncio import serve from pathlib import Path @@ -45,7 +45,9 @@ def gencert(): for file_name, data in [('cert.pem', io.BytesIO(crypto.dump_certificate(crypto.FILETYPE_PEM, cert))), ('privkey.pem', io.BytesIO(crypto.dump_privatekey(crypto.FILETYPE_PEM, k)))]: zip_file.writestr(file_name, data.getvalue()) - return Response(zip_buffer.getvalue(), mimetype="application/zip") + resp = make_response(zip_buffer.getvalue(), mimetype="application/zip") + resp.set_cookie('GFG','ComputerScience Portal') + return resp @app.route("/style.css") def style(): return send_file("style.css")