microsoft / typed-rest-client

Node Rest and Http Clients with typings for use with TypeScript
Other
675 stars 118 forks source link

Allow no user agent to be passed #156

Closed damccorm closed 5 years ago

damccorm commented 5 years ago

If they explicitly pass in null or undefined we shouldn't attach the header to avoid issues like #154. In theory this could break someone, but only if all of the following conditions are met:

1) They are currently passing in null or undefined for the userAgent (not just ''). Note that this is not allowed by our typing, but some JS clients or TS clients without strict typing could in theory be doing this 2) The endpoint they are hitting requires a userAgent header but allows it to be empty

This feels pretty low risk to me so I think a minor version bump should be fine.

Fixes #154

stephenmichaelf commented 5 years ago

Can we add tests for this

bryanmacfarlane commented 5 years ago

Resolve the conflicts and we can merge

rumblefrog commented 4 years ago

Could we also add this to the RestClient's typing?

damccorm commented 4 years ago

@rumblefrog sure! Added https://github.com/microsoft/typed-rest-client/pull/193