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

Adding Middleware to FastAPI Initialization #427

Merged
merged 1 commit into from
Nov 5, 2023

Conversation

koid
Copy link

@koid koid commented Nov 5, 2023

PR Type:

Bug fix


PR Description:

This PR addresses a bug where middleware was not being added during the initialization of FastAPI in a lambda function. The following changes have been made:

  • Middleware has been imported from starlette.
  • Middleware has been added to the FastAPI app during initialization.

PR Main Files Walkthrough:

files:

pr_agent/servers/serverless.py: Middleware has been imported from starlette and added to the FastAPI app during its initialization. This change ensures that the middleware is correctly set up when the FastAPI app is created.


User Description

In a function for a Lambda function, middleware was not added during the initialization of FastAPI, and it was causing a ContextDoesNotExistError, so I added the middleware.

@koid
Copy link
Author

koid commented Nov 5, 2023

/describe

@github-actions github-actions bot changed the title fix: Add middleware when initializing fastapi Adding Middleware to FastAPI Initialization Nov 5, 2023
@mrT23 mrT23 merged commit c917e48 into Codium-ai:main Nov 5, 2023
@koid koid deleted the fix/add-middleware branch November 5, 2023 10:58
yochail pushed a commit to yochail/pr-agent that referenced this pull request Feb 11, 2024
Adding Middleware to FastAPI Initialization
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants