Skip to content

Conversation

Aschen
Copy link
Contributor

@Aschen Aschen commented Aug 30, 2021

What does this PR do ?

This PR allows to define custom HTTP headers that will be send with every request made by the SDK.

Those headers are defined when instantiating the HTTP protocol:

const kuzzle = new Kuzzle(new Http('localhost', { 
  headers: {
    'Accept-Encoding': 'gzip, deflate'
  }
}));

For example, this allows to use a different Accept-Encoding header to use gzip or deflate compression with Kuzzle

@codecov
Copy link

codecov bot commented Aug 30, 2021

Codecov Report

Merging #661 (895efef) into 7-dev (1900bf0) will increase coverage by 0.08%.
The diff coverage is 91.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##            7-dev     #661      +/-   ##
==========================================
+ Coverage   85.68%   85.77%   +0.08%     
==========================================
  Files          36       36              
  Lines        1712     1715       +3     
  Branches      311      314       +3     
==========================================
+ Hits         1467     1471       +4     
+ Misses        183      182       -1     
  Partials       62       62              
Impacted Files Coverage Δ
src/protocols/Http.ts 84.00% <91.66%> (+0.86%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1900bf0...895efef. Read the comment docs.

@rolljee rolljee merged commit 174ae31 into 7-dev Sep 1, 2021
@rolljee rolljee deleted the allow-custom-http-headers branch September 1, 2021 10:24
@Aschen Aschen mentioned this pull request Sep 6, 2021
Aschen added a commit that referenced this pull request Sep 7, 2021
# [7.7.5](https://github.com/kuzzleio/sdk-javascript/releases/tag/7.7.5) (2021-09-06)


#### Bug fixes

- [ [#660](#660) ] Fix upsert options.default    ([Aschen](https://github.com/Aschen))

#### Enhancements

- [ [#661](#661) ] Allows to define custom headers for HTTP protocol   ([Aschen](https://github.com/Aschen))
---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants