Skip to content

Commit 0cdff2b

Browse files
committed
requestID removed from JSON response, will be provided as header value
1 parent ad2816c commit 0cdff2b

File tree

2 files changed

+0
-7
lines changed

2 files changed

+0
-7
lines changed

api/controllers/ip.go

-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ type IPResult struct {
1313
Action string `json:"action"`
1414
Company string `json:"company"`
1515
Country string `json:"country"`
16-
RequestID string `json:"id"`
1716
BadReputation bool `json:"bad"`
1817
Bot bool `json:"bot"`
1918
Datacenter bool `json:"dc"`
@@ -77,7 +76,6 @@ func (i *IP) Check(addr string) (*IPResult, error) {
7776
Company: info.Company,
7877
Tor: info.IsTor,
7978
Proxy: info.IsProxy,
80-
RequestID: info.RequestID,
8179
SearchEngine: info.IsSearchEngine,
8280
Private: info.IsPrivate,
8381
Spam: info.IsSpam,

ip/ip.go

-5
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ package ip
22

33
import (
44
"context"
5-
"math/rand" // #nosec
65
"net"
7-
"strconv"
86
"time"
97

108
"github.com/optimatiq/threatbite/ip/datasource"
@@ -18,7 +16,6 @@ type Info struct {
1816
Company string
1917
Country string
2018
Hostnames []string
21-
RequestID string
2219
IsProxy bool
2320
IsSearchEngine bool
2421
IsTor bool
@@ -162,12 +159,10 @@ func (i *IP) GetInfo(ip net.IP) (*Info, error) {
162159
score = 100
163160
}
164161

165-
// TODO(RW) the request_id is already generated at the middleware level it should be passed here
166162
return &Info{
167163
Company: company,
168164
Country: country,
169165
IsProxy: isProxy,
170-
RequestID: "ID" + strconv.FormatInt(rand.Int63n(9223372036854775807), 10), // #nosec
171166
IsSearchEngine: isSearch,
172167
IsTor: isTor,
173168
Hostnames: hostnames,

0 commit comments

Comments
 (0)