I am currently using Swagger UI version 3.19.0 with Flask-RestPlus version 0.13.0 and testing out unauthorised (401) response of uploading file endpoint of my deployed python flask application on Chrome. The problem is that I am getting TypeError: Failed to fetch with error net::ERR_HTTP2_PROTOCOL_ERROR instead of 401 responses. I can see from my server logs that my backend is returning correct 401 responses. I am using gunicorn gateway with keep-alive set to true and uploading zip file with size > 64KB. The swagger ui is working fine for all other endpoints receiving correct responses from the server. Surprisingly, I tested the same file upload endpoint on Firefox browser and it has no problem returning correct 401 responses. It seems that this TypeError only occurs on chrome browser.
[Update]
I investigated further into the chrome-net-export-log.json file and found out the below logs. It seems that while the browser is sending the zip file and when it counters upload stream reset due to unauthorised request, it is not receiving the incoming unauthorised response and just throw ERR_HTTP2_PROTOCOL_ERROR
HTTP2_STREAM_UPDATE_SEND_WINDOW
--> delta = -13505
--> stream_id = 23
--> window_size = 105
UPLOAD_DATA_STREAM_READ [dt=0]
--> current_position = 1875012
HTTP2_STREAM_UPDATE_SEND_WINDOW
--> delta = -154
--> stream_id = 23
--> window_size = 0
HTTP2_STREAM_UPDATE_RECV_WINDOW
--> delta = -32
--> stream_id = 23
--> window_size = 6314596
HTTP2_STREAM_ERROR
--> description = "Server reset stream."
--> net_error = "ERR_HTTP2_PROTOCOL_ERROR"
--> stream_id = 23
-HTTP_TRANSACTION_SEND_REQUEST
--> net_error = -337 (ERR_HTTP2_PROTOCOL_ERROR)
-URL_REQUEST_START_JOB
--> net_error = -337 (ERR_HTTP2_PROTOCOL_ERROR)
URL_REQUEST_DELEGATE_RESPONSE_STARTED [dt=0]
-CORS_REQUEST
-URL_REQUEST_DELEGATE_RESPONSE_STARTED
-REQUEST_ALIVE
--> net_error = -337 (ERR_HTTP2_PROTOCOL_ERROR)
May i have suggestions and solutions for this problem and Thank you in advance.