fix: not necessarily an api key is needed
This commit is contained in:
parent
709705282a
commit
e9b4276698
@ -16,10 +16,11 @@ import (
|
|||||||
|
|
||||||
var pasteURL = os.Getenv("PASTEBIN_URL")
|
var pasteURL = os.Getenv("PASTEBIN_URL")
|
||||||
var key = os.Getenv("AUTH_KEY")
|
var key = os.Getenv("AUTH_KEY")
|
||||||
|
var authParam = os.Getenv("AUTH_PARAM")
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
if pasteURL == "" || key == "" {
|
if pasteURL == "" {
|
||||||
fmt.Println("Please set PASTEBIN_URL and AUTH_KEY environment variables")
|
fmt.Println("Please set PASTEBIN_URL environment variable")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,7 +81,7 @@ func uploadFile(file string) (*http.Request, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// set headers
|
// set headers
|
||||||
req.Header.Set("X-Auth", key)
|
req.Header.Set(authParam, key)
|
||||||
req.Header.Set("Content-Type", writer.FormDataContentType())
|
req.Header.Set("Content-Type", writer.FormDataContentType())
|
||||||
|
|
||||||
return req, nil
|
return req, nil
|
||||||
|
Loading…
Reference in New Issue
Block a user