voliva / angular2-interceptors

79 stars 20 forks source link

Shallow copy options #30

Closed andrewstuart closed 6 years ago

andrewstuart commented 6 years ago

angular2-interceptors is modifying incoming options objects.

This poses a problem when the same options object is cached and reused by calling code.

This pull request adds and uses a method for creating a shallow copy of the options object so that no parameters are modified, and cannot break calling code.

voliva commented 6 years ago

Looks good and simple, thank you!