DO_NOT_MERGE feat($resource): Make stripping of trailing slashes configurable.

This is only to run tests on Travis before merging #5560 to `master`.