Skip to content

Commit

Permalink
fix: clone requestbody to new scope (#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
themez committed Jul 6, 2020
1 parent e19e17a commit 7c5f125
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ func (scope *Scope) Clone() *Scope {
clone.level = scope.level
clone.transaction = scope.transaction
clone.request = scope.request
clone.requestBody = scope.requestBody

return clone
}
Expand Down
2 changes: 2 additions & 0 deletions scope_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,11 @@ func TestAddBreadcrumbAddsTimestamp(t *testing.T) {
func TestScopeBasicInheritance(t *testing.T) {
scope := NewScope()
scope.SetExtra("a", 1)
scope.SetRequestBody([]byte("requestbody"))
clone := scope.Clone()

assertEqual(t, scope.extra, clone.extra)
assertEqual(t, scope.requestBody, clone.requestBody)
}

func TestScopeParentChangedInheritance(t *testing.T) {
Expand Down

0 comments on commit 7c5f125

Please sign in to comment.