Skip to content

Commit

Permalink
ref: Rename ClientOptions.SendDefaultPii to ClientOptions.SendDefault…
Browse files Browse the repository at this point in the history
…PII (#490)
  • Loading branch information
cleptric authored Nov 2, 2022
1 parent 3bb8296 commit 19c8481
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- fix: Scope values should not override Event values (#446)
- feat: Extend User inteface by adding Data, Name and Segment (#483)
- feat: Make maximum amount of spans configurable (#460)
- feat: Add ClientOptions.SendDefaultPii #485
- feat: Add ClientOptions.SendDefaultPII (#485)

## 0.14.0

Expand Down
2 changes: 1 addition & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ type ClientOptions struct {
IgnoreErrors []string
// If this flag is enabled, certain personally identifiable information (PII) is added by active integrations.
// By default, no such data is sent.
SendDefaultPii bool
SendDefaultPII bool
// BeforeSend is called before error events are sent to Sentry.
// Use it to mutate the event or return nil to discard the event.
// See EventProcessor if you need to mutate transactions.
Expand Down
2 changes: 1 addition & 1 deletion fasthttp/sentryfasthttp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func TestIntegration(t *testing.T) {

eventsCh := make(chan *sentry.Event, len(tests))
err := sentry.Init(sentry.ClientOptions{
SendDefaultPii: true,
SendDefaultPII: true,
BeforeSend: func(event *sentry.Event, hint *sentry.EventHint) *sentry.Event {
eventsCh <- event
return event
Expand Down
2 changes: 1 addition & 1 deletion http/sentryhttp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func TestIntegration(t *testing.T) {

eventsCh := make(chan *sentry.Event, len(tests))
err := sentry.Init(sentry.ClientOptions{
SendDefaultPii: true,
SendDefaultPII: true,
BeforeSend: func(event *sentry.Event, hint *sentry.EventHint) *sentry.Event {
eventsCh <- event
return event
Expand Down
2 changes: 1 addition & 1 deletion interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func NewRequest(r *http.Request) *Request {
headers := map[string]string{}

if client := CurrentHub().Client(); client != nil {
if client.Options().SendDefaultPii {
if client.Options().SendDefaultPII {
// We read only the first Cookie header because of the specification:
// https://tools.ietf.org/html/rfc6265#section-5.4
// When the user agent generates an HTTP request, the user agent MUST NOT
Expand Down
4 changes: 2 additions & 2 deletions interfaces_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func TestUserMarshalJson(t *testing.T) {
func TestNewRequest(t *testing.T) {
currentHub.BindClient(&Client{
options: ClientOptions{
SendDefaultPii: true,
SendDefaultPII: true,
},
})
// Unbind the client afterwards, to not affect other tests
Expand Down Expand Up @@ -105,7 +105,7 @@ func TestNewRequest(t *testing.T) {
}
}

func TestNewRequestWithNoPii(t *testing.T) {
func TestNewRequestWithNoPII(t *testing.T) {
const payload = `{"test_data": true}`
r := httptest.NewRequest("POST", "/test/?q=sentry", strings.NewReader(payload))
r.Header.Add("Authorization", "Bearer 1234567890")
Expand Down

0 comments on commit 19c8481

Please sign in to comment.