Explorar el Código

Unset Set-Cookie when serving static files

pull/65/head
Ben Kurtovic hace 5 meses
padre
commit
32ac770abc
Se han modificado 1 ficheros con 6 adiciones y 1 borrados
  1. +6
    -1
      src/copyvios/__init__.py

+ 6
- 1
src/copyvios/__init__.py Ver fichero

@@ -3,7 +3,7 @@ import logging
import os
from logging.handlers import TimedRotatingFileHandler

from flask import Flask, request
from flask import Flask, Response, request


class CopyviosFlask(Flask):
@@ -12,6 +12,11 @@ class CopyviosFlask(Flask):
return 365 * 24 * 60 * 60
return super().get_send_file_max_age(filename)

def send_static_file(self, filename: str) -> Response:
response = super().send_static_file(filename)
response.headers.pop("Set-Cookie", None)
return response


app = CopyviosFlask(
"copyvios",


Cargando…
Cancelar
Guardar