-
Notifications
You must be signed in to change notification settings - Fork 414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Complain about values to be string instead of integers #211
Comments
True! Headers values must be ASCI strings: I thought that the conversion would be done automatically by Rack, but it looks like that's not the case. I will change the integers to strings directly in the |
Thanks, any ETO this be pushed in rubygems? |
Sorry for the late answer. I was waiting to add a couple of commits, but it looks like I have no time. Tomorrow I will be able to push 6a93b97 |
Pushed to Rubygems |
Hey ! Thank you @ddnexus and @germanolleunlp I think it's a good PR but this should be release as a major version because I think it's could be a breaking change for lots of applications. I'm pretty sure that lots of people calculate their next page by doing something like: With integer, it's an addition like: But with string it's a concatenation like so: Using Thanks |
While this is a considerate concern, it doesn't look like the change can break much if anything at all. The headers returned to the client were strings before the change and they are still strings after the change, so whatever code was working on the client side will still work. On the server side the Of course you can override the method if you want to change its logic... and in that case you are in total control of the calculation and returned values. The change could in theory break overridden Consider that if you need custom headers involving page numbers, you are probably working with an API, and in that case you are probably using the That complex interaction of coincidences looks like a very remote possibility to me. But even if that rare case happens, spotting the problem (by running the app just once) and fixing it is so trivial that I could be considered as part of the normal routine adjustment when you upgrade any gem, especially if you overrode something of it. |
Seems that some services expect to have these values as strings instead of integers.
One workaround is override this method but could be useful to return these values directly as strings or provide an easy way to customize this.
The text was updated successfully, but these errors were encountered: