Closed nemosupremo closed 10 years ago
WebContext FileExtention function also returns the query parameters. For example with a path like so: /query.csv?a=b&c=d, the function returns .csv?a=b&c=d, while I would have expected just .csv
/query.csv?a=b&c=d
.csv?a=b&c=d
.csv
I assume the fix is just something like:
func (c *WebContext) FileExtension() string { ext := strings.ToLower(path.Ext(c.HttpRequest().URL.RequestURI())) if idx := strings.Index("?", ext); idx != -1 { ext = ext[:idx] } return ext }
Hey - if you could submit a PR that'd be awesome? (see https://github.com/stretchr/goweb/wiki/Development-practices)
WebContext FileExtention function also returns the query parameters. For example with a path like so:
/query.csv?a=b&c=d
, the function returns.csv?a=b&c=d
, while I would have expected just.csv
I assume the fix is just something like: