Update response headers, regenerate image on each join

This commit is contained in:
Brandon Sturgeon 2021-02-16 12:35:58 -08:00 committed by Brandon Sturgeon
parent 53f78031f5
commit 804949b357
2 changed files with 3 additions and 2 deletions

View File

@ -25,6 +25,7 @@ http {
listen 80;
location /avatars/ {
add_header 'Cache-Control' 'public, s-maxage 3600, proxy-revalidate';
include /etc/nginx/mime.types;
root /usr/share/nginx/html;
autoindex on;

View File

@ -1,6 +1,6 @@
from PIL import Image, ImageDraw
from flask import Flask, request, send_file
import os.path
import os
import requests
@ -21,7 +21,7 @@ def outline():
avatar_path = f"/avatars/{image_name}.png"
if os.path.isfile(avatar_path):
return f"{base_url}{avatar_path}"
os.remove(avatar_path)
outline_color = content["outlineColor"] # "255 255 255 255"
outline_color = outline_color.split(" ") # ["255", "255", "255", "255"]