From e5b6da438da8f0a35aa0ba8854177886f562c392 Mon Sep 17 00:00:00 2001 From: jolav Date: Mon, 6 Feb 2023 17:44:53 +0100 Subject: [PATCH] 0.7.20 banned list autoupdate + minor fix on proxy and stats --- .gitignore | 1 + README.md | 4 ++-- _utils/stats.go | 2 +- main.go | 2 +- proxy/proxy.go | 1 - www/_public/templates/version.html | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 7595e30..00fca87 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ _data/ _private.js _private.json a_private.go +banned.list # # diff --git a/README.md b/README.md index 8b353bd..4458c41 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -![Version](https://img.shields.io/badge/version-0.7.18-orange.svg) +![Version](https://img.shields.io/badge/version-0.7.20-orange.svg) ![Maintained YES](https://img.shields.io/badge/Maintained%3F-yes-green.svg) ![Ask Me Anything !](https://img.shields.io/badge/Ask%20me-anything-1abc9c.svg) # ![logo](https://github.com/jolav/codetabs/blob/master/www/_public/icons/ct/ct64r.png?raw=true) **ONLINE TOOLS ([codetabs.com](https://codetabs.com))** -**version 0.7.18** +**version 0.7.20** 1. [Count LOC (lines of code) online from github/gitlab repos or zipped uploaded folder](#count-loc-online) 2. [CORS proxy](#cors-proxy) diff --git a/_utils/stats.go b/_utils/stats.go index 4386fbe..cc59432 100644 --- a/_utils/stats.go +++ b/_utils/stats.go @@ -19,7 +19,7 @@ func AddHit(w http.ResponseWriter, r *http.Request, if host == "" { host = " ? " } - quest := strings.Split(r.URL.String(), "v1/")[1] + quest := r.Form.Get("quest") if mode == "production" { hLog.Println(ip, sv, host, quest) hitUrl := "http://localhost:3970/addHit/" + service diff --git a/main.go b/main.go index fd9ceb6..12ebe5c 100644 --- a/main.go +++ b/main.go @@ -24,7 +24,7 @@ import ( we "github.com/jolav/codetabs/weather" ) -var version = "0.7.19" +var version = "0.7.20" var when = "undefined" type Conf struct { diff --git a/proxy/proxy.go b/proxy/proxy.go index 582a265..04ebf59 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -35,7 +35,6 @@ func (p *proxy) Router(w http.ResponseWriter, r *http.Request) { u.BadRequest(w, r) return } - p.quest = strings.Split(r.URL.RawQuery, "quest=")[1] p.doProxyRequest(w, r) } diff --git a/www/_public/templates/version.html b/www/_public/templates/version.html index b7f31a4..78d5b61 100644 --- a/www/_public/templates/version.html +++ b/www/_public/templates/version.html @@ -2,7 +2,7 @@

API doc - (version 0.7.18) + (version 0.7.20)