From b513ccbbd9e0da6f0be687f8e63e04aec0be23fa Mon Sep 17 00:00:00 2001 From: mutantmonkey Date: Wed, 14 Oct 2015 19:23:47 -0700 Subject: [PATCH] remove auth support --- README.md | 1 - linx.go | 14 -------------- 2 files changed, 15 deletions(-) diff --git a/README.md b/README.md index 162b4b1..ef574d4 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,6 @@ Here's an example config file: server: http://example.com proxy: socks5://127.0.0.1:9050 uploadlog: /home/mutantmonkey/.local/share/golinx/linx.log -authkey: hackme ``` ## License diff --git a/linx.go b/linx.go index 9e1bffa..b943255 100644 --- a/linx.go +++ b/linx.go @@ -23,7 +23,6 @@ import ( type Config struct { Server string Proxy string - AuthKey string UploadLog string } @@ -35,11 +34,6 @@ type LinxJSON struct { Size string } -func createAuthHeader(authKey string) string { - const authPrefix = "Linx " - return authPrefix + base64.StdEncoding.EncodeToString([]byte(authKey)) -} - func getDeleteKeys(config *Config) (keys map[string]string) { keys = make(map[string]string) @@ -115,10 +109,6 @@ func linx(config *Config, filepath string, ttl int, deleteKey string) { req.Header.Add("Linx-Delete-Key", deleteKey) } - if config.AuthKey != "" { - req.Header.Add("Authorization", createAuthHeader(config.AuthKey)) - } - resp, err := client.Do(req) if err != nil { log.Fatalf("Failed to issue request: %v\n", err) @@ -172,10 +162,6 @@ func unlinx(config *Config, url string, deleteKey string) bool { req.Header.Add("User-Agent", "golinx") req.Header.Add("Linx-Delete-Key", deleteKey) - if config.AuthKey != "" { - req.Header.Add("Authorization", createAuthHeader(config.AuthKey)) - } - resp, err := client.Do(req) if err != nil { log.Fatalf("Failed to issue request: %v\n", err)