go-spatial / tegola

Tegola is a Mapbox Vector Tile server written in Go
http://tegola.io/
MIT License
1.29k stars 196 forks source link

Make sure to strip "/" for static files if URIPrefix ends with a "/" #771

Closed gdey closed 3 years ago

gdey commented 3 years ago

When serving up static files we need to strip any proxy prefixes we may add onto the URL. We forgot to check to see if the prefix had a "/" at the end of it, and if it did made sure to strip it out, as static files should always start with a "/". However, if we did not remove the "/" at the end of the prefix that we then use to trim the url; we would end up trimming off the starting "/". This fixes that.

Fixes #735

gdey commented 3 years ago

Have not had a chance to test this yet.

coveralls commented 3 years ago

Pull Request Test Coverage Report for Build 8e011cb69-PR-771


Changes Missing Coverage Covered Lines Changed/Added Lines %
server/viewer.go 0 9 0.0%
<!-- Total: 0 9 0.0% -->
Files with Coverage Reduction New Missed Lines %
server/viewer.go 1 40.0%
<!-- Total: 1 -->
Totals Coverage Status
Change from base Build 7908653b9: -0.03%
Covered Lines: 5413
Relevant Lines: 11925

💛 - Coveralls