summaryrefslogtreecommitdiff
path: root/web/controllers/reflect_ip.go
blob: 556f15b79b91095c140ac866263805a8092a7cc4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package controllers

import (
	"net/http"

	"github.com/gin-gonic/gin"

	"code.crute.me/mcrute/frame"
)

func ReflectIP(c *gin.Context) {
	ip := frame.GetRequestIP(c)
	if ip == nil {
		c.String(http.StatusInternalServerError, "")
		return
	}

	c.String(http.StatusOK, ip.String())
}