More data to return to client

This commit is contained in:
George Shammas 2014-07-09 19:57:43 +00:00
parent 433c9a9e60
commit 7fbc0ab612
2 changed files with 8 additions and 4 deletions

View File

@ -51,6 +51,10 @@ func mainHandler(c *gin.Context) {
c.Set("ua", c.Req.UserAgent()) c.Set("ua", c.Req.UserAgent())
c.Set("lang", c.Req.Header.Get("Accept-Language")) c.Set("lang", c.Req.Header.Get("Accept-Language"))
c.Set("encoding", c.Req.Header.Get("Accept-Encoding")) c.Set("encoding", c.Req.Header.Get("Accept-Encoding"))
c.Set("method", c.Req.Method)
c.Set("mime", c.Req.Header.Get("Accept"))
c.Set("referer", c.Req.Header.Get("Referer"))
c.Set("forwarded", c.Req.Header.Get("X-Forwarded-For"))
hostnames, err := net.LookupAddr(ip.IP.String()) hostnames, err := net.LookupAddr(ip.IP.String())
if err != nil { if err != nil {

View File

@ -90,7 +90,7 @@
<td>Encoding</td><td>{{ .encoding }}</td> <td>Encoding</td><td>{{ .encoding }}</td>
</tr> </tr>
<tr> <tr>
<td>MIME Type</td><td>{{ .mime_type }}</td> <td>MIME Type</td><td>{{ .mime }}</td>
</tr> </tr>
<tr> <tr>
<td>Charset</td><td>{{ .charset }}</td> <td>Charset</td><td>{{ .charset }}</td>
@ -99,7 +99,7 @@
<td>Via</td><td>{{ .via }}</td> <td>Via</td><td>{{ .via }}</td>
</tr> </tr>
<tr> <tr>
<td>X-Forwarded-For</td><td>{{ .x_forwarded_for }}</td> <td>X-Forwarded-For</td><td>{{ .forwarded }}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -139,7 +139,7 @@
<td>$ curl ifconfig.io/encoding</td><td>{{ .encoding }}</td> <td>$ curl ifconfig.io/encoding</td><td>{{ .encoding }}</td>
</tr> </tr>
<tr> <tr>
<td>$ curl ifconfig.io/mime</td><td>{{ .mime_type }}</td> <td>$ curl ifconfig.io/mime</td><td>{{ .mime }}</td>
</tr> </tr>
<tr> <tr>
<td>$ curl ifconfig.io/charset</td><td>{{ .charset }}</td> <td>$ curl ifconfig.io/charset</td><td>{{ .charset }}</td>
@ -148,7 +148,7 @@
<td>$ curl ifconfig.io/via</td><td>{{ .via }}</td> <td>$ curl ifconfig.io/via</td><td>{{ .via }}</td>
</tr> </tr>
<tr> <tr>
<td>$ curl ifconfig.io/forwarded</td><td>{{ .x_forwarded_for }}</td> <td>$ curl ifconfig.io/forwarded</td><td>{{ .forwarded }}</td>
</tr> </tr>
<tr> <tr>
<td>$ curl ifconfig.io/all</td><td>{{ .hash_as_yaml }}</td> <td>$ curl ifconfig.io/all</td><td>{{ .hash_as_yaml }}</td>