diff --git a/README.md b/README.md index 626e4ee..754d194 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,6 @@ Tiny https redirect application written in go for the sole purpose of redirectin # Configuration | Environment Variable | Description | | ---------------------| ------------------------- | -| REDIRECT_HOST | Specifies a host that will replace the host in the request when the redirect url is built. | +| REDIRECT_HOSTNAME | Specifies a host that will replace the host in the request when the redirect url is built. | | USE_HTTP | Causes the redirect to use HTTP instead of HTTPS. Specifying anything Anything will activate this. (eg,. USE_HTTP=true) | diff --git a/circle.yml b/circle.yml index 9083f2c..b21fa7e 100644 --- a/circle.yml +++ b/circle.yml @@ -25,8 +25,8 @@ deployment: - go get github.com/tcnksm/ghr - gox -osarch="linux/amd64" -output="dist/{{.OS}}_{{.Arch}}" ./src/ # - ghr -t $GITHUB_TOKEN -u $CIRCLE_PROJECT_USERNAME -r $CIRCLE_PROJECT_REPONAME --replace `git describe --tags` dist/ - - docker build --tag=jdavis7257/tiny-redirect:0.1 . + - docker build --tag=jdavis7257/tiny-redirect:0.2 . - docker build --tag=jdavis7257/tiny-redirect:latest . - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS - - docker push jdavis7257/tiny-redirect:0.1 + - docker push jdavis7257/tiny-redirect:0.2 - docker push jdavis7257/tiny-redirect:latest diff --git a/src/redirect.go b/src/redirect.go index 59c8c97..42b5047 100644 --- a/src/redirect.go +++ b/src/redirect.go @@ -46,7 +46,7 @@ func handle(w http.ResponseWriter, r *http.Request) { path := r.RequestURI //If some passes http as a path then slap them on the hand with a bad request. - if(strings.HasPrefix(path,"/http:") || strings.HasPrefix(path,"/HTTP:")) { + if(strings.HasPrefix(path,"/http:") || strings.HasPrefix(path,"/HTTP:")|| strings.Contains(path,"comhttp")) { fmt.Println("Someone is trying to do something nasty. Returning 400.") http.Error(w,"Bad Request",http.StatusBadRequest) } else {