@@ -25,7 +25,7 @@ func (bs BlossomServer) handleUploadCheck(w http.ResponseWriter, r *http.Request
2525 blossomError (w , "missing \" Authorization\" header" , 401 )
2626 return
2727 }
28- if auth .Tags .GetFirst ([] string { "t" , "upload" } ) == nil {
28+ if auth .Tags .FindWithValue ( "t" , "upload" ) == nil {
2929 blossomError (w , "invalid \" Authorization\" event \" t\" tag" , 403 )
3030 return
3131 }
@@ -59,7 +59,7 @@ func (bs BlossomServer) handleUpload(w http.ResponseWriter, r *http.Request) {
5959 blossomError (w , "missing \" Authorization\" header" , 401 )
6060 return
6161 }
62- if auth .Tags .GetFirst ([] string { "t" , "upload" } ) == nil {
62+ if auth .Tags .FindWithValue ( "t" , "upload" ) == nil {
6363 blossomError (w , "invalid \" Authorization\" event \" t\" tag" , 403 )
6464 return
6565 }
@@ -163,13 +163,13 @@ func (bs BlossomServer) handleGetBlob(w http.ResponseWriter, r *http.Request) {
163163
164164 // if there is one, we check if it has the extra requirements
165165 if auth != nil {
166- if auth .Tags .GetFirst ([] string { "t" , "get" } ) == nil {
166+ if auth .Tags .FindWithValue ( "t" , "get" ) == nil {
167167 blossomError (w , "invalid \" Authorization\" event \" t\" tag" , 403 )
168168 return
169169 }
170170
171- if auth .Tags .GetFirst ([] string { "x" , hhash } ) == nil &&
172- auth .Tags .GetFirst ([] string { "server" , bs .ServiceURL } ) == nil {
171+ if auth .Tags .FindWithValue ( "x" , hhash ) == nil &&
172+ auth .Tags .FindWithValue ( "server" , bs .ServiceURL ) == nil {
173173 blossomError (w , "invalid \" Authorization\" event \" x\" or \" server\" tag" , 403 )
174174 return
175175 }
@@ -239,7 +239,7 @@ func (bs BlossomServer) handleList(w http.ResponseWriter, r *http.Request) {
239239
240240 // if there is one, we check if it has the extra requirements
241241 if auth != nil {
242- if auth .Tags .GetFirst ([] string { "t" , "list" } ) == nil {
242+ if auth .Tags .FindWithValue ( "t" , "list" ) == nil {
243243 blossomError (w , "invalid \" Authorization\" event \" t\" tag" , 403 )
244244 return
245245 }
@@ -283,7 +283,7 @@ func (bs BlossomServer) handleDelete(w http.ResponseWriter, r *http.Request) {
283283 }
284284
285285 if auth != nil {
286- if auth .Tags .GetFirst ([] string { "t" , "delete" } ) == nil {
286+ if auth .Tags .FindWithValue ( "t" , "delete" ) == nil {
287287 blossomError (w , "invalid \" Authorization\" event \" t\" tag" , 403 )
288288 return
289289 }
@@ -296,8 +296,8 @@ func (bs BlossomServer) handleDelete(w http.ResponseWriter, r *http.Request) {
296296 return
297297 }
298298 hhash = hhash [1 :]
299- if auth .Tags .GetFirst ([] string { "x" , hhash } ) == nil &&
300- auth .Tags .GetFirst ([] string { "server" , bs .ServiceURL } ) == nil {
299+ if auth .Tags .FindWithValue ( "x" , hhash ) == nil &&
300+ auth .Tags .FindWithValue ( "server" , bs .ServiceURL ) == nil {
301301 blossomError (w , "invalid \" Authorization\" event \" x\" or \" server\" tag" , 403 )
302302 return
303303 }
0 commit comments