Skip to content

Commit b286251

Browse files
committed
Update cors.js
1 parent 03d889c commit b286251

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

api/cors.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,14 @@ export default async function handler(request, response) {
3030

3131
url = new URL(url);
3232

33-
const options = {
34-
hostname: url.hostname,
35-
path: url.pathname,
36-
search: url.search,
37-
method: 'GET',
38-
headers: {
39-
'Content-Type': 'application/json'
40-
}
33+
const options = new URL(url);
34+
35+
options.headers = {
36+
'Content-Type': 'application/json'
4137
};
4238

39+
options.method = 'GET';
40+
4341
const req = https.request(options, (resp) => {
4442

4543
let data = '';

0 commit comments

Comments
 (0)