Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor dialer.go code improvements #61

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading