fix: expire header timezone (#1840)
Signed-off-by: Jim Ma <majinjing3@gmail.com>
This commit is contained in:
parent
3582a10b91
commit
1c24c3fc8c
|
|
@ -435,7 +435,8 @@ func (s *server) recursiveDownloadWithP2PMetadata(
|
|||
// update url scheme
|
||||
purl.Scheme = source.ListMetadataScheme
|
||||
// update cache expire time
|
||||
urlMeta.Header[source.ListMetadataExpire] = time.Now().Add(s.cacheRecursiveMetadata).Format(source.ExpireLayout)
|
||||
// The target format is GMT time, need convert to UTC time first
|
||||
urlMeta.Header[source.ListMetadataExpire] = time.Now().Add(s.cacheRecursiveMetadata).UTC().Format(source.ExpireLayout)
|
||||
|
||||
rc, _, err := s.peerTaskManager.StartStreamTask(ctx, &peer.StreamTaskRequest{
|
||||
URL: purl.String(),
|
||||
|
|
|
|||
|
|
@ -16,7 +16,10 @@
|
|||
|
||||
package source
|
||||
|
||||
import "net/textproto"
|
||||
import (
|
||||
"net/http"
|
||||
"net/textproto"
|
||||
)
|
||||
|
||||
const (
|
||||
// Range is different with HTTP Range, it's without "bytes=" prefix
|
||||
|
|
@ -24,8 +27,8 @@ const (
|
|||
)
|
||||
|
||||
const (
|
||||
LastModifiedLayout = "Mon, 02 Jan 2006 15:04:05 GMT"
|
||||
ExpireLayout = "Mon, 02 Jan 2006 15:04:05 GMT"
|
||||
LastModifiedLayout = http.TimeFormat
|
||||
ExpireLayout = http.TimeFormat
|
||||
)
|
||||
|
||||
type ExpireInfo struct {
|
||||
|
|
|
|||
Loading…
Reference in New Issue