Skip to content
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

Validate limit if offset is specified #90

Merged
merged 1 commit into from
Sep 29, 2017
Merged

Validate limit if offset is specified #90

merged 1 commit into from
Sep 29, 2017

Conversation

jntullo
Copy link

@jntullo jntullo commented Sep 29, 2017

Currently if offset is specified and limit is set to 0 (ie limit=0&offset=5), the following error is returned due to division by 0:

{
    "error": {
        "kind": "internal_server_error",
        "message": "Infinity",
        "klass": "FloatDomainError"
    }
}

This updates the LinksBuilder to validate that the limit is greater than 0 if offset is specified.

BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1489885

@miq-bot add_label bug
@miq-bot assign @abellotti

@miq-bot miq-bot added the bug label Sep 29, 2017
@abellotti abellotti added this to the Sprint 70 Ending Oct 2, 2017 milestone Sep 29, 2017
@abellotti
Copy link
Member

LGTM!! Thanks @jntullo for the fix. will merge when 🍏

@miq-bot
Copy link
Member

miq-bot commented Sep 29, 2017

Checked commit jntullo@b3f7db5 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
2 files checked, 0 offenses detected
Everything looks fine. 👍

@abellotti abellotti merged commit e6b4979 into ManageIQ:master Sep 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants