this is a backport of #8115 to fix #7842
The problem was already fixed in master, the solution used for 3-2-stable is different.
@rafaelfranca as discussed.
Now we need the CHANGELOG entry
backport, handle trailing slash with engines
my bad. Thanks for the double-check. Created the entry.