Skip to content

HttpContext only holding default values in dotnet core 2.1 #18472

@agchaudhury

Description

@agchaudhury

I have recently upgraded an application created in dotnet core 1.0 to 2.1. And ever since HttpContext, the application was using to retrieve information, is only having default values and the following lines of code are failing:

if (!HttpContext.Items.Keys.Contains(Utility.APIGATEWAY_REQUEST)) { //log error }

var apiGatewayRequest = HttpContext.Items[Utility.APIGATEWAY_REQUEST] as APIGatewayProxyRequest;

All the HttpContext is fetching is:
HttpContext

The UI of the same is made in Angular which makes service calls to AWS Lambdas (made using dotnet core) for all the requirements. User data is stored in AWS Cognito and every time a service call is made it first gets verified by fetching data from Cognito. This part stopped working after the framework upgrade.

Custom api gateway authorizer is used for Cognito and also HttpContext is used inside a controller.

I am not sure if this scenario using Angular, DotNet Core 2.1, AWS Lambda, AWS Cognito, Custom api gateway authorizer was ever tested but I am stuck.

Please provide some inputs or some workaround.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions