|
@@ -1,3 +1,29 @@
|
|
|
+/*
|
|
|
+ GNU GENERAL PUBLIC LICENSE
|
|
|
+ Version 3, 29 June 2007
|
|
|
+
|
|
|
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
|
+ Everyone is permitted to copy and distribute verbatim copies
|
|
|
+ of this license document, but changing it is not allowed.
|
|
|
+
|
|
|
+ http-wokou, An HTTP Proxying framework for bypassing DNS Security
|
|
|
+ Copyright (C) 2024 Russell Hrubesky, ChiralWorks Software LLC
|
|
|
+
|
|
|
+ This program is free software: you can redistribute it and/or modify
|
|
|
+ it under the terms of the GNU General Public License as published by
|
|
|
+ the Free Software Foundation, either version 3 of the License, or
|
|
|
+ (at your option) any later version.
|
|
|
+
|
|
|
+ This program is distributed in the hope that it will be useful,
|
|
|
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
+ GNU General Public License for more details.
|
|
|
+
|
|
|
+ You should have received a copy of the GNU General Public License
|
|
|
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
+
|
|
|
+*/
|
|
|
+
|
|
|
package httpserver
|
|
|
|
|
|
import (
|
|
@@ -13,39 +39,6 @@ import (
|
|
|
"golang.org/x/net/publicsuffix"
|
|
|
)
|
|
|
|
|
|
-// TODO: does tihs need to be a configuration thing? How would i handle doing rewrite rules?
|
|
|
-// TODO: make these routes cached on the proxy, so that when a client requests them, they arent being tunneled through to the actual site
|
|
|
-var staticRoutes = map[string]struct{}{
|
|
|
- "/siteaudit/i18n": struct{}{},
|
|
|
- "/siteaudit/index": struct{}{},
|
|
|
- "/siteaudit/review": struct{}{},
|
|
|
- "/seo-dashboard/release": struct{}{},
|
|
|
- "/competitive-list-widget": struct{}{},
|
|
|
- "/backlink-audit/landing": struct{}{},
|
|
|
- "/link-building-tool/landing": struct{}{},
|
|
|
- "/keyword-overview": struct{}{},
|
|
|
- "/keyword-gap": struct{}{},
|
|
|
- "/oti/prod/organic_traffic_insights": struct{}{},
|
|
|
- "/oti/prod/organic-traffic-insights": struct{}{},
|
|
|
- "/ajst": struct{}{},
|
|
|
- "/listing-management/landings": struct{}{},
|
|
|
- "/listing-management/landing-reviews": struct{}{},
|
|
|
- "/messaging/apps/": struct{}{},
|
|
|
- "/domain-overview": struct{}{},
|
|
|
- "/traffic-analytics": struct{}{},
|
|
|
- "/organic-research": struct{}{},
|
|
|
- "/keyword-magic/kmt_": struct{}{},
|
|
|
- "/keyword-manager-assets": struct{}{},
|
|
|
- "/position-tracking/landing": struct{}{},
|
|
|
-}
|
|
|
-
|
|
|
-var apiRoutes = map[string]struct{}{
|
|
|
- "/siteaudit/api/campaigns/seolist": struct{}{},
|
|
|
- "/siteaudit/api/system-status": struct{}{},
|
|
|
- "/siteaudit/api/limits": struct{}{},
|
|
|
- "/projects/api/limits": struct{}{},
|
|
|
-}
|
|
|
-
|
|
|
// Implementing a 'set'
|
|
|
var NonmutableHeaders = map[string]struct{}{
|
|
|
"Cookie": struct{}{},
|
|
@@ -97,7 +90,7 @@ This handler will be responsible for proxying out the GET requests that the serv
|
|
|
func (c *Controller) Get(ctx *gin.Context) {
|
|
|
incomingPath := ctx.Param("ProxiedPath")
|
|
|
routeSplit := strings.Split(incomingPath, "/")
|
|
|
- if len(routeSplit) > 2 {
|
|
|
+ if len(routeSplit) > 1 {
|
|
|
baseRoute := strings.Join(routeSplit[:len(routeSplit)-1], "/")
|
|
|
|
|
|
_, ok := c.RouteMaps[c.Config.AltAllowedDomain].RouteSet[baseRoute]
|