-
Notifications
You must be signed in to change notification settings - Fork 0
/
501.patch
31 lines (27 loc) · 968 Bytes
/
501.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
--- server.go 2024-04-22 09:05:43
+++ server-501.go 2020-10-14 10:50:08
@@ -14,7 +14,7 @@
limitations under the License.
*/
-// A webserver that only serves a 404 page. Used as a default backend.
+// A webserver that only serves a 501 page. Used as a default backend.
package main
import (
@@ -30,7 +30,7 @@
func main() {
// command line arguments
- port := flag.Int("port", 8080, "Port number to serve default backend 404 page.")
+ port := flag.Int("port", 8080, "Port number to serve default backend 501 page.")
timeout := flag.Duration("timeout", 5*time.Second, "Time in seconds to wait before forcefully terminating the server.")
flag.Parse()
@@ -76,8 +76,8 @@
fmt.Fprint(w, "ok")
})
s.mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
- w.WriteHeader(http.StatusNotFound)
- fmt.Fprint(w, "default backend - 404")
+ w.WriteHeader(http.StatusNotImplemented)
+ fmt.Fprint(w, "default backend - 501")
})
return s
}