Skip to content

Commit

Permalink
Merge pull request #19 from sfomuseum/ignore-prefix
Browse files Browse the repository at this point in the history
Update tilePattern and metadataPattern to allow leading prefixes
  • Loading branch information
bdon committed Oct 13, 2022
2 parents 0493afb + ece5bbc commit 14a2737
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pmtiles/loop.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ func (loop *Loop) get_tile(ctx context.Context, http_headers map[string]string,
return 204, http_headers, nil
}

var tilePattern = regexp.MustCompile(`^\/([-A-Za-z0-9_]+)\/(\d+)\/(\d+)\/(\d+)\.([a-z]+)$`)
var metadataPattern = regexp.MustCompile(`^\/([-A-Za-z0-9_]+)\/metadata$`)
var tilePattern = regexp.MustCompile(`.*?\/([-A-Za-z0-9_]+)\/(\d+)\/(\d+)\/(\d+)\.([a-z]+)$`)
var metadataPattern = regexp.MustCompile(`.*?\/([-A-Za-z0-9_]+)\/metadata$`)

func (loop *Loop) Get(ctx context.Context, path string) (int, map[string]string, []byte) {
http_headers := make(map[string]string)
Expand Down

0 comments on commit 14a2737

Please sign in to comment.