From 542510aa484ecbc6c11c513289e95a151e59783d Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Wed, 12 Feb 2025 18:26:01 +0800 Subject: [PATCH] http_router.go: Move from router.go and fix conditional placement bug --- router.go => router_http.go | 10 +++++----- diff --git a/router.go b/router_http.go rename from router.go rename to router_http.go index c8436985fa2738b051215122ad58f619b0f82be3..abf47c247e5d407c588f064c29699bd6e20de5ba 100644 --- a/router.go +++ b/router_http.go @@ -16,12 +16,12 @@ http.Error(w, err.Error(), http.StatusBadRequest) return } - if len(segments) < 2 { - http.Error(w, "Blank system endpoint", http.StatusNotFound) - return - } - if segments[0] == ":" { + if len(segments) < 2 { + http.Error(w, "Blank system endpoint", http.StatusNotFound) + return + } + switch segments[1] { case "static": static_handler.ServeHTTP(w, r) -- 2.48.1