7digital / SevenDigital.Api.Wrapper

A fluent c# wrapper for the 7digital API
MIT License
16 stars 29 forks source link

Wrapper is unforgiving when trailing the Api Uri with a / #204

Closed danhaller closed 10 years ago

danhaller commented 10 years ago

When using the wrapper the user must create a class that implements IApiUri.

If the Uri ends in a trailing slash i.e. http://api.7digital.com/1.2/ the request url is generated with a double slash which can cause problems with OAuth endpoints because the signature calculations take the request url into account. The resulting error is misleading.

I suggest that the wrapper should be able to handle an ApiUri with or without a trailing slash.

danhaller commented 10 years ago

I can take a look at this when I have a little more time

AnthonySteele commented 10 years ago

Sounds reasonable, you might want something like Path.Combine, which is forgiving w.r.t slashes http://stackoverflow.com/questions/372865/path-combine-for-urls

AnthonySteele commented 10 years ago

PR submitted: https://github.com/7digital/SevenDigital.Api.Wrapper/pull/210