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

SendException and SendMessage fails for content type: application/json #54

Closed
daithimaolain opened this issue Apr 21, 2017 · 3 comments
Closed
Assignees
Labels

Comments

@daithimaolain
Copy link

daithimaolain commented Apr 21, 2017

Exception Message: "Incorrect Content-Type: application/json; charset=UTF-8"
StackTrace

   at Microsoft.AspNetCore.Http.Features.FormFeature.ReadForm()
   at RollbarDotNet.Builder.RequestBuilder.BuildRequest(Request request)
   at RollbarDotNet.Builder.RequestBuilder.Execute(Payload payload)
   at RollbarDotNet.Rollbar.ExecuteBuilders(Payload payload)
   at RollbarDotNet.Rollbar.SetupPayload(RollbarLevel level)
   at RollbarDotNet.Rollbar.<SendException>d__14.MoveNext()

This could be because I am calling SendException from custom middleware.

Thanks.

@StrangeWill StrangeWill self-assigned this Apr 21, 2017
@StrangeWill StrangeWill modified the milestone: 0.5.2 Apr 21, 2017
@StrangeWill
Copy link
Contributor

This could be because I am calling SendException from custom middleware.

Actually entirely possible that this is the cause -- I'm wondering if something isn't available that RollbarDotNet's BuildRequest function is expecting, because it crawls all over the context trying to gather information about the current request.

@StrangeWill
Copy link
Contributor

Seems to be caused when trying to access context.Request.Form

Only reproduction I can find of this issue is here: aspnet/Security#1069 and here: JeffreySu/WeiXinMPSDK#283, the second link suggests we can add a second check to the post check to validate there are form fields available.

I'll see about getting this done and out later today @daithimaolain.

@StrangeWill
Copy link
Contributor

0.5.2 has been published and fixes this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants