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

Request body logging isn't working for server requests #84

Closed
flash286 opened this issue Nov 13, 2019 · 5 comments
Closed

Request body logging isn't working for server requests #84

flash286 opened this issue Nov 13, 2019 · 5 comments

Comments

@flash286
Copy link
Contributor

Hello everyone,
Trying to use request body logging in some cases, but it doesn't seem to be working

request := sentry.Request{}
request = request.FromHTTPRequest(req)

request.Data is always empty :(

I guess a problem can be here

if request.GetBody != nil {
		if bodyCopy, err := request.GetBody(); err == nil && bodyCopy != nil {
			body, err := ioutil.ReadAll(bodyCopy)
			if err == nil {
				r.Data = string(body)
			}
		}
	}

request.GetBody is always == nil and Doc says

For server requests, it is unused.

request.Body looks like a right field.

@flash286
Copy link
Contributor Author

up

@aschade92
Copy link

I'm having the same issue

@kamilogorek
Copy link
Contributor

@flash286 @aschade92 I'll take a look at it in the morning

@flash286
Copy link
Contributor Author

@kamilogorek let me know if it's a bug. I'm ready to make PR.

@rhcarvalho
Copy link
Contributor

Hi @flash286! I can confirm this is a bug, thank you for reporting it 😄

Please go ahead and send in a PR, I'll be happy to help you get that merged. Thanks!

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

No branches or pull requests

5 participants