Updates "type" field to absolute URI, recursively.
(ctx *Context)
| 74 | |
| 75 | // Updates "type" field to absolute URI, recursively. |
| 76 | func (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 | |
| 96 | const ( |
| 97 | problemTempKeyPrefix = "@temp_" |
no test coverage detected