explore/projects filter search box breaks pagination

Summary

Using the text filter box breaks pagination on explore/projects. Looks like Kaminari picks up that it loads the result HTML via /explore/projects.json, and maintains the .json when generating the links.

This seems to be limited to certain subsets of the /explore/projects endpoints. I don't think it happens on /explore/projects/trending.

Steps to reproduce

  • Go to gitlab.com/explore/projects?non_archived=true&page=500&sort=latest_activity_desc
  • Put some text in "Filter by name..." field
  • Wait for it to load results
  • Clear the text field
  • Scroll down and click the next page link
  • It will take you to a JSON page

What is the current bug behavior?

It takes you to /explore/projects.json

What is the expected correct behavior?

It should take you to /explore/projects

Relevant logs and/or screenshots

explore_projects_json_bug

Output of checks

This bug happens on GitLab.com