See the accepted answer to this question: https://webmasters.stackexchange.com/questions/81252/is-a-trailing-slash-appropriate-before-url-parameters
tl;dr Either way is correct, but consistency in the result is the key to best SEO practices, because with/without is a different URL.
If you don’t want the trailing slash (or you do), you can change it in your Admin, Permalinks screen.