Skip to content

Commit

Permalink
remove auth support
Browse files Browse the repository at this point in the history
  • Loading branch information
mutantmonkey committed Oct 15, 2015
1 parent e06b6e8 commit b513ccb
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 0 additions & 14 deletions linx.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
type Config struct {
Server string
Proxy string
AuthKey string
UploadLog string
}

Expand All @@ -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)

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit b513ccb

Please sign in to comment.