Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ project adheres to [Semantic Versioning](http://semver.org/).

### Changed

- Disable custom content encoding for pushgateway delete requests in order to
avoid failures from the server when using `Content-Encoding: gzip` header.
- Refactor `escapeString` helper in `lib/registry.js` to improve performance and
avoid an unnecessarily complex regex.

Expand Down
3 changes: 3 additions & 0 deletions lib/pushgateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ async function useGateway(method, job, groupings) {
});

return new Promise((resolve, reject) => {
if (method === 'DELETE' && options.headers) {
delete options.headers['Content-Encoding'];
}
const req = httpModule.request(options, resp => {
let body = '';
resp.setEncoding('utf8');
Expand Down