Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 1 addition & 9 deletions server/bootserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"context"
"encoding/json"
"fmt"
"net"
"net/http"
"path"
"path/filepath"
Expand Down Expand Up @@ -375,14 +374,7 @@ func handleHTTPBoot(w http.ResponseWriter, r *http.Request, k8sClient client.Cli
log.Info("Processing HTTPBoot request", "method", r.Method, "path", r.URL.Path, "clientIP", r.RemoteAddr)
ctx := r.Context()

clientIP, _, err := net.SplitHostPort(r.RemoteAddr)
if err != nil {
log.Error(err, "Failed to parse client IP address", "clientIP", r.RemoteAddr)
http.Error(w, "Internal Server Error", http.StatusInternalServerError)
return
}

clientIPs := []string{clientIP}
var clientIPs []string
if xff := r.Header.Get("X-Forwarded-For"); xff != "" {
for _, ip := range strings.Split(xff, ",") {
trimmedIP := strings.TrimSpace(ip)
Expand Down
2 changes: 1 addition & 1 deletion server/bootserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var _ = Describe("BootServer", func() {
Expect(body.UKIURL).To(Equal(defaultUKIURL))

By("including the recorded client IPs")
Expect(body.ClientIPs).NotTo(BeEmpty())
Expect(body.ClientIPs).To(BeEmpty())

By("not setting a SystemUUID in the default case")
Expect(body.SystemUUID).To(SatisfyAny(BeEmpty(), Equal("")))
Expand Down
Loading