summaryrefslogtreecommitdiff
path: root/web/controllers/reflect_ip.go
blob: 199d7361bce753e76d79ffd8aeca7aba1c6aac19 (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/go_ddns_manager/util"
)

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

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