1
0
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:
Gerasimos (Makis) Maropoulos
2024-05-23 15:23:29 +03:00
parent 4117f3b88f
commit e89806766a
5 changed files with 288 additions and 103 deletions

View File

@@ -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)
}