Skip to content

Commit

Permalink
Merge pull request #11 from orkunkaraduman/develop
Browse files Browse the repository at this point in the history
v0.6.1
  • Loading branch information
orkunkaraduman authored Aug 28, 2023
2 parents daf6de5 + e1ea99e commit 146d465
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions httputil/cachecontrol.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import (

type CacheControl map[string]string

func ParseCacheControl(directive string) CacheControl {
opts := ParseOptions(directive)
if len(opts) <= 0 {
return nil
func ParseCacheControl(directive string) (c CacheControl) {
c = map[string]string{}
for _, opt := range ParseOptions(directive) {
c[opt.KeyVals[0].Key] = opt.KeyVals[0].Val
}
return opts[0].Map
return
}

func (c CacheControl) MaxAge() time.Duration {
Expand Down

0 comments on commit 146d465

Please sign in to comment.