jsperf / jsperf.com

jsperf.com v2. https://github.com/h5bp/lazyweb-requests/issues/174
https://jsperf.com/
MIT License
1.31k stars 128 forks source link

Test case named "search" exists, interferes with search functionality #504

Open AjaxGb opened 5 years ago

AjaxGb commented 5 years ago

Apparently, the user @bkfarnsworth created a perfectly normal test case in November 2018, and happened to name it "search". This caused it to overlap with the https://jsperf.com/search page, so no matter what you enter in the search bar it takes you to bk's test case instead of a results page.

Additionally, entering the query into the URL manually (as in https://jsperf.com/search?q=example) just displays "something went wrong". I suspect this may be related.

Creating test cases that share a name with built-in site URLs should not be allowed.

maxbeatty commented 5 years ago

Creating test cases that share a name with built-in site URLs should not be allowed.

Here is where we check if a slug is available. Here is where we check against registered routes with the server. Here is the relevant Hapi documentation. Here is the existing unit test. Here is where the search route is declared.

If the attempted slug is "search" but the registered path is "/search{ext?}", then path.substr(1) === slug won't be true and a page will be registered with a generic collision.

I don't have time to fix this. As a workaround, you could search Google with site:jsperf.com like this.