MCPcopy Index your code
hub / github.com/kataras/iris / updateURIsToAbs

Method updateURIsToAbs

context/problem.go:76–94  ·  view source on GitHub ↗

Updates "type" field to absolute URI, recursively.

(ctx *Context)

Source from the content-addressed store, hash-verified

74
75// Updates "type" field to absolute URI, recursively.
76func (p Problem) updateURIsToAbs(ctx *Context) {
77 if p == nil {
78 return
79 }
80
81 if uriRef := p.getURI("type"); uriRef != "" && !strings.HasPrefix(uriRef, "http") {
82 p.Type(ctx.AbsoluteURI(uriRef))
83 }
84
85 if uriRef := p.getURI("instance"); uriRef != "" {
86 p.Instance(ctx.AbsoluteURI(uriRef))
87 }
88
89 if cause, ok := p["cause"]; ok {
90 if causeP, ok := cause.(Problem); ok {
91 causeP.updateURIsToAbs(ctx)
92 }
93 }
94}
95
96const (
97 problemTempKeyPrefix = "@temp_"

Callers 1

ProblemMethod · 0.80

Calls 4

getURIMethod · 0.95
TypeMethod · 0.95
InstanceMethod · 0.95
AbsoluteURIMethod · 0.80

Tested by

no test coverage detected