-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add http headers #202
Conversation
cli/cobra.go
Outdated
@@ -59,7 +59,10 @@ func Client(apiUlr, userID, password, otp string) (c *proxmox.Client, err error) | |||
if otp == "" { | |||
otp = os.Getenv("PM_OTP") | |||
} | |||
c, err = proxmox.NewClient(apiUlr, nil, tlsconf, proxyUrl, timeout) | |||
if http_headers == "" { | |||
otp = os.Getenv("HTTP_HEADERS") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, overlooked it my bad.
cli/cobra.go
Outdated
@@ -59,7 +59,10 @@ func Client(apiUlr, userID, password, otp string) (c *proxmox.Client, err error) | |||
if otp == "" { | |||
otp = os.Getenv("PM_OTP") | |||
} | |||
c, err = proxmox.NewClient(apiUlr, nil, tlsconf, proxyUrl, timeout) | |||
if http_headers == "" { | |||
http_headers = os.Getenv("HTTP_HEADERS") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use PM_HTTP_HEADERS for coherence with other envs, what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works out for me.
I just ran this PR code with no PM_HTTP_HEADERS set and it does not work
|
feat: add http headers
Add support for http headers, fixes feature request #196.
Credits to @forthal for helping me out.