Reputation: 1
I am running Flask inside of a python-based Docker container. I've observed the following error whenever I make a request:
INFO:werkzeug:172.20.0.1 - - [25/Feb/2025 05:42:42] "OPTIONS /api/v1/account/details HTTP/1.1" 200 -
ERROR:root:{'host': 'localhost:8081',
'user-agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64;
rv:135.0) Gecko/20100101 Firefox/135.0', 'accept': 'application/json,
text/plain, */*', 'accept-language': 'en-US,en;q=0.5',
'accept-encoding': 'gzip, deflate, br, zstd',
'x-csrftoken': 'SAMPLE_CSRF_TOKEN_HERE',
'origin': 'http://localhost:3001', 'dnt': '1',
'connection': 'keep-alive',
'referer': 'http://localhost:3001/', 'cookie':
'_ga_ZJSLW8V4Q5=GS1.1.1725316386.6.1.1725316418.0.0.0;
_ga=GA1.1.1054852537.1724777625;
_ga_8XB4XKKWWW=GS1.1.1736912730.24.1.1736912747.0.0.0;
session=TS41FRlA7Oh5K2BBIWEExksXS9HujD0a88qE_Yc7yHo;
X-CSRF=SAMPLE_CSRF_TOKEN_HERE',
'sec-fetch-dest': 'empty', 'sec-fetch-mode': 'cors', 'sec-fetch-site':
'same-site', 'priority': 'u=0'
}
INFO:werkzeug:172.20.0.1 - - [25/Feb/2025 05:42:42] "GET /api/v1/account/details HTTP/1.1" 200 -
This occurs after every request is made to my backend, whether it is successful or not.
Originally, I had thought that the error was a result of my CORS policy being too loose, so I made it stricter, but saw the same issue. I have CORS policy set up as follows:
CORS(app,
resources=
{r"/api/*": {
"origins": ["http://localhost:3001"],
"methods": ["GET", "POST", "PUT", "DELETE"],
"allow_headers": [
"Content-Type",
"Authorization",
"X-CSRF-Token",
"X-CSRFToken",
"x-csrftoken"
],
"supports_credentials": True
}
}
)
However, the ERROR:root
still appears even with a stricter CORS. Any ideas as to what is causing this message in the Docker logs?
Upvotes: 0
Views: 24