We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b5212d6 commit ea4fd3dCopy full SHA for ea4fd3d
go.mod
@@ -0,0 +1,3 @@
1
+module github.com/servian/https-echo
2
+
3
+go 1.12
main.go
@@ -3,14 +3,15 @@ package main
import (
4
"flag"
5
"fmt"
6
+ "io"
7
"log"
8
"net/http"
9
"os"
10
"strings"
11
)
12
13
// Version number constant.
-const Version = "0.0.4"
14
+const Version = "0.0.5"
15
16
// Homepage url.
17
const Homepage = "https://github.com/servian/https-echo"
@@ -22,6 +23,11 @@ var (
22
23
24
25
func redirect(w http.ResponseWriter, req *http.Request) {
26
+ w.Header().Set("Server", "Https-echo/"+Version+" (+"+Homepage+")")
27
+ if "/health" == req.URL.Path {
28
+ io.WriteString(w, "Healthy.\n")
29
+ return
30
+ }
31
hostname := strings.Split(req.Host, ":")
32
dps := ""
33
if *destPort > 0 {
0 commit comments