Links joins the links followed by the property to populate the response's Link HTTP header field.
(link ...string)
| 600 | |
| 601 | // Links joins the links followed by the property to populate the response's Link HTTP header field. |
| 602 | func (r *DefaultRes) Links(link ...string) { |
| 603 | if len(link) == 0 { |
| 604 | return |
| 605 | } |
| 606 | bb := bytebufferpool.Get() |
| 607 | for i := range link { |
| 608 | if i%2 == 0 { |
| 609 | bb.WriteByte('<') |
| 610 | bb.WriteString(link[i]) |
| 611 | bb.WriteByte('>') |
| 612 | } else { |
| 613 | bb.WriteString(`; rel="`) |
| 614 | bb.WriteString(link[i]) |
| 615 | bb.WriteString(`",`) |
| 616 | } |
| 617 | } |
| 618 | r.setCanonical(HeaderLink, utils.TrimRight(r.c.app.toString(bb.Bytes()), ',')) |
| 619 | bytebufferpool.Put(bb) |
| 620 | } |
| 621 | |
| 622 | // Location sets the response Location HTTP header to the specified path parameter. |
| 623 | func (r *DefaultRes) Location(path string) { |
nothing calls this directly
no test coverage detected