mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Docs: update Changelog with backendSrv plugin notice (#23244)
* Chore: updates CHANGELOG * Docs: updates after PR comments
This commit is contained in:
parent
aae76d797b
commit
6402dde646
17
CHANGELOG.md
17
CHANGELOG.md
@ -45,6 +45,23 @@ backendSrv.get(‘http://your.url/api’).then(result => {
|
||||
});
|
||||
```
|
||||
|
||||
Another unfortunate outcome from this work in `backendSrv` is that the response format for `.headers()` changed from a function to an object.
|
||||
|
||||
To make your plugin work on 6.7.x as well as on previous versions you should add something like the following:
|
||||
|
||||
```typescript
|
||||
let responseHeaders = response.headers;
|
||||
if (!responseHeaders) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Support pre 6.7 angular HTTP rather than fetch
|
||||
if (typeof responseHeaders === 'function') {
|
||||
responseHeaders = responseHeaders();
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
You can test your plugin with the `master` branch version of Grafana.
|
||||
|
||||
### Features / Enhancements
|
||||
|
Loading…
Reference in New Issue
Block a user