Skip to content

Commit

Permalink
rest: gin: Don'trust all proxies
Browse files Browse the repository at this point in the history
This follows the recommendation from
https://github.com/gin-gonic/gin/blob/master/docs/doc.md#dont-trust-all-proxies

Signed-off-by: Christophe Fergeau <[email protected]>
  • Loading branch information
cfergeau committed Feb 16, 2024
1 parent b20e58c commit 7fad3ea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/config/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func (bootloader *LinuxBootloader) MarshalJSON() ([]byte, error) {

type virtioNetForMarshalling struct {
VirtioNet
MacAddress string `json:"macAddress"`
MacAddress string `json:"macAddress,omitempty"`
}

func (dev *VirtioNet) MarshalJSON() ([]byte, error) {
Expand Down
4 changes: 4 additions & 0 deletions pkg/rest/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ func NewServer(inspector VirtualMachineInspector, stateHandler VirtualMachineSta
if err != nil {
return nil, err
}
err = r.SetTrustedProxies(nil)
if err != nil {
return nil, err
}
s := VFKitService{
router: r,
Endpoint: ep,
Expand Down

0 comments on commit 7fad3ea

Please sign in to comment.