Skip to content

Commit

Permalink
feat: remove refer by header extra logic and remove prefix Parse from…
Browse files Browse the repository at this point in the history
… methods
  • Loading branch information
emiago committed Dec 19, 2024
1 parent 27a286e commit 848901f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions sip/headers.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ func HeaderClone(h Header) Header {
type headers struct {
headerOrder []Header

// Here we only need headers that have frequent access.
// DO not add any custom headers, or more specific headers
via *ViaHeader
from *FromHeader
to *ToHeader
Expand All @@ -49,8 +51,6 @@ type headers struct {
route *RouteHeader
recordRoute *RecordRouteHeader
maxForwards *MaxForwardsHeader
referTo *ReferToHeader
referredBy *ReferredByHeader
}

func (hs *headers) String() string {
Expand Down Expand Up @@ -409,17 +409,17 @@ func (hs *headers) RecordRoute() *RecordRouteHeader {
return hs.recordRoute
}

// ReferTo returns underlying Refer-To parsed header or nil if not exists
func (hs *headers) ParseReferTo() *ReferToHeader {
// ReferTo parses underlying Refer-To header or nil if not exists
func (hs *headers) ReferTo() *ReferToHeader {
h := &ReferToHeader{}
if parseHeaderLazy(hs, parseReferToHeader, []string{"refer-to"}, h) {
return h
}
return nil
}

// ReferredBy returns underlying Referred-By parsed header or nil if not exists
func (hs *headers) ParseReferredBy() *ReferredByHeader {
// ReferredBy parses underlying Referred-By header or nil if not exists
func (hs *headers) ReferredBy() *ReferredByHeader {
h := &ReferredByHeader{}
if parseHeaderLazy(hs, parseReferredByHeader, []string{"referred-by"}, h) {
return h
Expand Down

0 comments on commit 848901f

Please sign in to comment.