mirror of
https://github.com/kataras/iris.git
synced 2026-01-01 01:07:06 +00:00
x/jsonx: ISO8601: add support for unconventional offset timestamps
This commit is contained in:
12
aliases.go
12
aliases.go
@@ -4,6 +4,7 @@ import (
|
||||
"io/fs"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"path"
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -325,15 +326,10 @@ type prefixedDir struct {
|
||||
}
|
||||
|
||||
func (p *prefixedDir) Open(name string) (http.File, error) {
|
||||
destPath, _, ok, err := context.SafeFilename(p.prefix, name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !ok {
|
||||
return nil, http.ErrMissingFile // unsafe.
|
||||
}
|
||||
// Don't do this: as this is responsibility of the underline fs.
|
||||
// _, filename, ok, err := context.SafeFilename("", name)
|
||||
|
||||
// name = path.Join(destPath, filename)
|
||||
destPath := path.Join(p.prefix, name)
|
||||
return p.fs.Open(destPath)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user