Skip to content

Commit

Permalink
Minor dialer.go code improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
vbanos authored and CorentinB committed Jan 20, 2025
1 parent 557c48d commit c11bcf6
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions dialer.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,6 @@ func (d *customDialer) writeWARCFromConnection(reqPipe, respPipe *io.PipeReader,
if d.proxyDialer == nil {
switch addr := conn.RemoteAddr().(type) {
case *net.UDPAddr:
IP := addr.IP.String()
r.Header.Set("WARC-IP-Address", IP)
case *net.TCPAddr:
IP := addr.IP.String()
r.Header.Set("WARC-IP-Address", IP)
Expand Down Expand Up @@ -601,8 +599,7 @@ func (d *customDialer) readRequest(scheme string, reqPipe *io.PipeReader, target
if strings.HasPrefix(target, scheme+"://"+host) {
warcTargetURI = target
} else {
warcTargetURI += host
warcTargetURI += target
warcTargetURI += host + target
}
} else {
return errors.New("unable to parse data necessary for WARC-Target-URI")
Expand Down

0 comments on commit c11bcf6

Please sign in to comment.