-
Notifications
You must be signed in to change notification settings - Fork 90
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
[Feature request] Auto-Capitalization of Header Keys #444
Comments
Actually the plugin doesnt capitalise. Only the curl command shows capitalise. The underlying library to show curl command capitalise. It is just representative command. So It must be something else. |
ok thanks for the response, I'll keep looking into it |
I did further investigation and found I was partially wrong here in above statement. Even though the infinity plugin or grafana doesn't capialize explicitly, golang does it by default. https://pkg.go.dev/net/http#Header.Set . BTW, the http standards suggest that the HTTP header keys should be case insensitive. somehow I can do workaround for your case but not sure how soon. Also not sure if it is worth the effort. I would suggest to fix the target system to accept case-insensitive headers to have an actual fix. For reference: |
Agreed that API should be case insensitive for header names. I actually reached out to the API owners to get this implemented. Thanks for taking a second look at this - something to keep in mind that can happen but not sure if worth the effort to implement a workaround |
One other note with the generated CURL text is that there appears to be an extra, unmatched quotation mark at the end that isn't matched. When I run in cmd it throws an error, and then when I delete this extra quote mark the command works as it should. Not sure if you see the same thing in your generated CURL |
We configured infinity plugin for our application but there is no option for access key & secret key to be applied. We are using "X-Auth_token" to authenticate but the token expiry is 24 hours only, after which we need to reset the header with new token. Could someone please provide the configuration file for secret & access key to get rid of manually entering the X-Auth-Token everyday. |
Describe the bug
When you enter in headers in either the data source or the query panel, the header key gets capitalized and this makes the query not work if the API you are querying is on the finicky side. For instance, if there is a required header called 'required-header' it gets changed in the actual query to 'Required-Header' and this makes queries not work for an API that I am using.
When I copy the cURL text and run it in command, the query at first does not work properly, but once I remove the capitalization from this header it works fine. Not sure if this is an issue with Grafana or the plugin itself.
Steps to reproduce
Not able to share credentials for the exact API that I am using, but if you enter in either an auth header or other custom header in the datasource or panel query, and then use the query inspector to view the cURL text, you will see that those fields get capitalized.
Note: bugs will be fixed only if enough information provided to reproduce the issue
Sample Data
Provide a link for sample data, or provide sample data bellow
Screenshots
Version Details:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: