janhommes / o.js

o.js - client side oData lib.
https://janhommes.github.io/o.js/example/
MIT License
238 stars 57 forks source link

o().conf({version: 2}) not working? #55

Closed be236 closed 6 years ago

be236 commented 6 years ago

Hi,

So I have OData service that supports version "4.0" string exactly, and if I use OData-Version header directly in o.js config or using curl, it works as I would expect.

But if I set this o() config to the above and use any value, like 2, or 5, etc... my OData service seems to ignore that value and continues to return all my data. I expected my service to reject me with an error, like "version 2 not supported."

Is this version field working correctly?

janhommes commented 6 years ago

We don't have any version headers in place currently. The version setting is just to let o.js know how to handle some request.

If you like you can submit a PR with strict header setting.

be236 commented 6 years ago

Can we turn this Issue into PR, then?

janhommes commented 6 years ago

Feel free to submit a PR (Pull Request). I personally have no time to do it. You can fork this repository, align it to your needs and submit a PR so everyone can use it.