Skip to content
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

fix/server-allowed-methods #598

Open
wants to merge 2 commits into
base: stable
Choose a base branch
from
Open
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 4.0.3

_Fixes:_

- Limited the the Access-Control-Allow-Methods CORS header to 'POST', 'GET' and 'OPTIONS'.

# 4.0.2

_Hotfix_:
Expand Down
6 changes: 1 addition & 5 deletions lib/highcharts.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,7 @@ export async function triggerExport(chartOptions, options, displayErrors) {
let constr = options.export.constr || 'chart';
constr = typeof Highcharts[constr] !== 'undefined' ? constr : 'chart';

Highcharts[constr](
'container',
finalOptions,
finalCallback
);
Highcharts[constr]('container', finalOptions, finalCallback);

// Get the current global options
const defaultOptions = getOptions();
Expand Down
6 changes: 5 additions & 1 deletion lib/server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ const app = express();
app.disable('x-powered-by');

// Enable CORS support
app.use(cors());
app.use(
cors({
methods: ['POST', 'GET', 'OPTIONS']
})
);

// Getting a lot of RangeNotSatisfiableError exception.
// Even though this is a deprecated options, let's try to set it to false.
Expand Down
Loading