Skip to content

Commit

Permalink
Access-Control-Allow-Origin: *
Browse files Browse the repository at this point in the history
  • Loading branch information
Darien Pardinas Diaz committed Aug 22, 2024
1 parent e6a5a2f commit 97f021b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## [0.0.10]

- Added `Access-Control-Allow-Origin: *` response header to allow calling VSCode REST Control from web browsers.

## [0.0.9]

- Add support for processing URL encoded requests in the form `?command=value&args=urlencoded-of-json-representation-of-args`.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "This extension allows you to remotely control Visual Studio Code via a REST endpoint, taking automation to the next level.",
"publisher": "dpar39",
"license": "MIT",
"version": "0.0.9",
"version": "0.0.10",
"engines": {
"vscode": "^1.55.0"
},
Expand Down
1 change: 1 addition & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const startHttpServer = async (
const endBadRequest = (err: any, res: ServerResponse) => {
res.statusCode = 400;
const errStringJson = JSON.stringify(err, Object.getOwnPropertyNames(err));
res.setHeader("Access-Control-Allow-Origin", "*");
res.write(errStringJson);
res.end();
Logger.error(errStringJson);
Expand Down

0 comments on commit 97f021b

Please sign in to comment.