generated from ipfs/ipfs-repository-template
-
Notifications
You must be signed in to change notification settings - Fork 150
Closed
Labels
need/triageNeeds initial labeling and prioritizationNeeds initial labeling and prioritizationtopic/gatewayIssues related to HTTP GatewayIssues related to HTTP Gateway
Description
Extracted from #176 (comment) to avoid blocking #176.
⚠️ sincepathMetadatais based onmaybeResolvedImPath, if the path is indeed resolved to the final/ipfs/cid, we will produce an invalidX-Ipfs-Rootsheader that does not include logical parents fromimmutableContentPath.Example:
immutableContentPath–/ipfs/cid/foo/barmaybeResolvedImPath–/ipfs/bar-cidX-Ipfs-Roots
- expected:
cid, foo-cid, bar-cid- produced:
bar-cid
Idea
Maybe some struct that gets passed around, like:
type requestData struct {
// Defined for all requests.
begin time.Time
logger *zap.SugaredLogger
contentPath ipath.Path
contentType string
contentTypeParams map[string]string
// Defined for non IPNS Record requests.
immutablePath ImmutablePath
// Defined if resolution has already happened.
pathMetadata *ContentPathMetadata
resolvedPath *ImmutablePath
}
func (rq *requestData) maybeResolvedPath() ImmutablePath {
if rq.resolvedPath != nil {
return *rq.resolvedPath
}
return rq.immutablePath
}### Tasks
- [ ] confirm header works as expected or there is a bug (if so, fix it)
- [ ] add regression test to https://github.com/ipfs/gateway-conformance for the Example above
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
need/triageNeeds initial labeling and prioritizationNeeds initial labeling and prioritizationtopic/gatewayIssues related to HTTP GatewayIssues related to HTTP Gateway