diff --git a/main.py b/main.py index 92b3fc3..0a881bc 100644 --- a/main.py +++ b/main.py @@ -5,9 +5,10 @@ Take existing calendar and update it slightly from datetime import date, datetime, time, timedelta import requests -from flask import Flask, Response, request +from flask import Flask, Response, request, make_response from icalendar import Calendar, Event from werkzeug.middleware.proxy_fix import ProxyFix +import logging app = Flask(__name__) app.wsgi_app = ProxyFix(app.wsgi_app, x_proto=1) # type: ignore[assignment] @@ -29,7 +30,8 @@ def process() -> Response: mins = int(request.args.get("mins", "0")) if orig.status_code != 200: - return Response(orig.text, headers=orig.headers, status=orig.status_code) + logging.warning("%s returned a %d", orig.request.url, orig.status_code) + return make_response(orig.text, orig.status_code) orig_cal = Calendar.from_ical(orig.text) cal = Calendar()