Skip to content

Conversation

@code-bunny
Copy link

@code-bunny code-bunny commented Jan 20, 2025

What is the current behaviour?

  • Currently the specs do not run on Ruby versions 3.3.x and 3.4.x.
  • Pagination meta links in responses will return an escaped self link if this was passed into the request. (The other links in the meta data will be unescaped.)

What is the new behaviour?

  • Specs now run on newer Ruby versions
  • Unescape request.fullpath to match output from other pagination methods

Checklist

Please make sure the following requirements are complete:

  • [ x ] Tests for the changes have been added (for bug fixes / features)
  • [ x ] Docs have been reviewed and added / updated if needed (for bug fixes /
    features)
  • [ x ] All automated checks pass (CI/CD)

@code-bunny code-bunny changed the title updates specs to run on newer ruby versions Updates specs to run on newer ruby versions, adds CGI.unescape to request.fullpath Jan 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, I also had to increase the sqlite3 version.

Copy link

@SamuelB-MT SamuelB-MT Dec 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, as seen in the screenshot request.fullpath is un-escaped, adding CGI.unescape resolves this gap:
image
I added puts debug statements to print the link without CGI.unescape (current code) and with CGI.unescape (proposed change).

Copy link

@SamuelB-MT SamuelB-MT Dec 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, I had to remove this line too to get the command rake spec to work without errors.
I also suggest an additional change:
image

Copy link

@SamuelB-MT SamuelB-MT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion these changes are valid, as I ran into similar problems and ended up with the same solution prior to checking this PR.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was getting several instances of the warning: Status code :unprocessable_entity is deprecated and will be removed in a future version of Rack. Please use :unprocessable_content instead.

This change removes said warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants