Skip to content

Commit 21e703a

Browse files
authored
Merge pull request #30 from bitmaelum/log8
either redirhash or routingid must be specified
2 parents 4a0b79e + 47e9445 commit 21e703a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/handler/address.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ func PostAddressHash(addrHash hash.Hash, req http.Request) *http.Response {
9898
return http.CreateError("error while posting record", 500)
9999
}
100100

101+
if uploadBody.RedirHash == "" && uploadBody.RoutingID == "" {
102+
log.Print(err)
103+
return http.CreateError("both redir hash and routing ID cannot be empty", 400)
104+
}
105+
101106
// Check if redirection is confirming our rules (maxdepth and cyclic dependency)
102107
httpErr = validateRedirection(uploadBody.RedirHash)
103108
if httpErr != nil {

0 commit comments

Comments
 (0)