I’m inconsistently receiving “CSRF token is missing” error when making POST request with Flask app deployed and run on a Docker container. For an exact same request sometimes the app accepts the request, sometimes it doesn’t.
When I run the app without container (executing flask run) the request works consistently with no error.
I’m new to Docker so would love to learn more.
OS Version: macOS Catalina (10.15)
Flask version 1.0.2
Docker version 2.1.0.2
An example request:
curl -X POST -H “X-CSRFToken: IjQwNWQ2NDNlZTc0ZDQ5N2RjOWVkNDkxNzA2NmQyZDVjY2E0N2RjYWIi.EJuftA.8T6qSDltggybSruWG7ihoFJum9E” -H “Cookie: session=eyJjc3JmX3Rva2VuIjoiNDA1ZDY0M2VlNzRkNDk3ZGM5ZWQ0OTE3MDY2ZDJkNWNjYTQ3ZGNhYiJ9.EJuftA.cSii-qKT0XktAiNf2rMBkQbBoIE” -F hed_strings=’{“hed_strings”: {“1”: {“type”:“event row”, “hed_string”: “Invalid/Tag”},“2”: {“type”:“event row”, “hed_string”:“Item/Object/Car”}}};type=application/json’ -v http://localhost:8080/eegsubmit