Skip to content

Commit

Permalink
fix: remove restful 'Accept-Encoding' header in browser environment.
Browse files Browse the repository at this point in the history
  • Loading branch information
dantio committed Nov 11, 2021
1 parent 31accd2 commit dd9db62
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 2 deletions.
75 changes: 74 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"readline": "^1.3.0",
"rimraf": "^3.0.2",
"rollup": "^2.28.2",
"rollup-plugin-strip-code": "^0.2.7",
"rollup-plugin-terser": "^7.0.2",
"sinon": "^7.4.2",
"standard-version": "^9.0.0",
Expand Down
7 changes: 6 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import strip from '@rollup/plugin-strip';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import json from '@rollup/plugin-json';
import stripCode from "rollup-plugin-strip-code"

export default {
input: 'lib/index.js',
Expand All @@ -29,7 +30,11 @@ export default {
include: [/^.+\.min\.js$/],
debugger: true,
// functions: ['console.log', 'assert.*', 'debug', 'alert'],
sourceMap: true
sourceMap: true,
}),
stripCode({
start_comment: 'START.NODE_ONLY',
end_comment: 'END.NODE_ONLY'
})
]
};
2 changes: 2 additions & 0 deletions src/api/restful/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import {AppConfig} from '../../types';
export const defaultApiHeaders: Record<string, string> = {
'Content-Type': 'application/json',
'Cache-Control': 'no-cache',
/*START.NODE_ONLY*/
'Accept-Encoding': 'application/gzip',
/*END.NODE_ONLY*/
}

const additionalHeaders: Record<string, string> = {
Expand Down

0 comments on commit dd9db62

Please sign in to comment.