1 parent
1aa710e712
commit
d4f257b71a
3 files changed
+7
-5
No files matched your search
@@ -15,6 +15,7 @@ FROM alpine:latest
|
||||
WORKDIR /app
|
||||
COPY --from=build /build/iplookup ./
|
||||
COPY template.html ./
|
||||
COPY favicon.png ./
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
+6
-5
@@ -420,11 +420,6 @@ func handler(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Println("Request:", r)
|
||||
}
|
||||
|
||||
if r.URL.Path == "/favicon.ico" {
|
||||
http.Error(w, "Not found", http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
|
||||
if r.Method != "GET" {
|
||||
http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)
|
||||
return
|
||||
@@ -465,6 +460,12 @@ func handler(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
}
|
||||
|
||||
if r.URL.Path == "/favicon.ico" {
|
||||
w.Header().Set("Content-Type", "image/png")
|
||||
http.ServeFile(w, r, "favicon.png")
|
||||
return
|
||||
}
|
||||
|
||||
args := strings.Split(r.URL.Path, "/")
|
||||
if len(args) > 1 && args[1] != "" {
|
||||
rtype := reqtype(args[1])
|
||||
|
||||
Reference in new issue
Block a user