Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insomnia freezes after redirecting the request with multipart file in the body #8398

Open
2 of 4 tasks
YFender opened this issue Feb 22, 2025 · 0 comments
Open
2 of 4 tasks
Assignees
Labels
B-bug Bug: general classification S-unverified Status: Unverified by maintainer

Comments

@YFender
Copy link

YFender commented Feb 22, 2025

Expected Behavior

A POST request containing a file in its body, formatted as multipart/form-data, is sent to the FastAPI server in a loop exceeding 100 iterations. The server, adhering to its default configuration, issues a redirect with a 307 status code to the same path, albeit without a trailing slash. Following this redirect, the request is expected to be successfully processed and returned.

Actual Behavior

When executed in a loop, after approximately 20–25 iterations, the server issues a redirect with a 307 status code; however, it ceases to receive any further requests from Insomnia. Meanwhile, Insomnia either halts at this iteration, continuously incrementing the execution time as if awaiting a prolonged server response, or displays an error dialog, as depicted in the screenshot provided below.
Image

Reproduction Steps

To reproduce the issue, it is sufficient to create a minimal FastAPI server where a function accepts a file and simply returns a response and send multiple requests to it in a loop.

import uvicorn
from fastapi import FastAPI, UploadFile

app = FastAPI()

@app.post("/uploadfile/")
async def upload_handler(file: UploadFile):
    return {"filename": file.filename}

if __name__ == "__main__":
    uvicorn.run("main:app", host="0.0.0.0", port=8000, reload=False)

As I said, file in the requests body must be in Multipart/form-data format.

Is there an existing issue for this?

Which sync method do you use?

  • Git sync.
  • Insomnia Cloud sync.
  • Local only

Additional Information

Notably, Insomnia does not freeze when sending a single request or when sending requests in a loop to the correct path that does not trigger a redirect. However, in such cases, the error dialog mentioned earlier appears upon completion of the loop. Additionally, I have confirmed that the server is functioning correctly and the issue does not originate from its side, as identical operations in Postman execute seamlessly without any problems.

Insomnia Version

10.3.1

What operating system are you using?

Windows

Operating System Version

Windows 11 LTSC 2H24

Installation method

downloaded from insomnia.rest

Last Known Working Insomnia version

No response

@YFender YFender added B-bug Bug: general classification S-unverified Status: Unverified by maintainer labels Feb 22, 2025
@YFender YFender changed the title Insomnia freezes after redirecting the request with file in the body Insomnia freezes after redirecting the request with multipart file in the body Feb 22, 2025
@CurryYangxx CurryYangxx self-assigned this Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-bug Bug: general classification S-unverified Status: Unverified by maintainer
Projects
None yet
Development

No branches or pull requests

2 participants