Skip to content

Commit

Permalink
fix: Allow Headers (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChefKai authored Feb 12, 2021
1 parent a50d179 commit fe54b4b
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion api/users/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { toChecksumAddress } from "ethereumjs-util";
import { getModel } from "../../utils/mongo";

export default async (req: NowRequest, res: NowResponse): Promise<NowResponse | void> => {
if (req.method === "OPTIONS") {
if (req.method?.toUpperCase() === "OPTIONS") {
return res.status(204).end();
}

Expand Down
2 changes: 1 addition & 1 deletion api/users/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { isValid, verifyMessage } from "../../utils";
import { getModel } from "../../utils/mongo";

export default async (req: NowRequest, res: NowResponse): Promise<NowResponse | void> => {
if (req.method === "OPTIONS") {
if (req.method?.toUpperCase() === "OPTIONS") {
return res.status(204).end();
}

Expand Down
2 changes: 1 addition & 1 deletion api/users/valid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { NowRequest, NowResponse } from "@vercel/node";
import { isValid } from "../../utils";

export default async (req: NowRequest, res: NowResponse): Promise<NowResponse | void> => {
if (req.method === "OPTIONS") {
if (req.method?.toUpperCase() === "OPTIONS") {
return res.status(204).end();
}

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pancake-profile-api",
"version": "1.0.4",
"version": "1.0.5",
"description": "Serverless API implementation for PancakeSwap Profile smart contract on Binance Smart Chain.",
"main": "api/version.ts",
"repository": "[email protected]:pancakeswap/pancake-profile-api.git",
Expand Down Expand Up @@ -30,6 +30,6 @@
"eslint-config-prettier": "^7.2.0",
"husky": "^4.3.8",
"prettier": "^2.2.1",
"typescript": "^4.1.4"
"typescript": "^4.1.5"
}
}
4 changes: 2 additions & 2 deletions vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
},
{
"key": "Access-Control-Allow-Methods",
"value": "GET, HEAD, POST, OPTIONS"
"value": "GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS"
},
{
"key": "Access-Control-Allow-Headers",
"value": "*"
"value": "Accept, Content-Type, Origin"
},
{
"key": "Access-Control-Max-Age",
Expand Down
36 changes: 18 additions & 18 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -228,17 +228,17 @@
integrity sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg==

"@types/mongodb@^3.5.27":
version "3.6.6"
resolved "https://registry.yarnpkg.com/@types/mongodb/-/mongodb-3.6.6.tgz#d62300927564e03daa08794eb207ff4f760f9014"
integrity sha512-ghYevKiSh/TGk2MAwSRZP7T1ilR9Pw8Fa7pT9GGVGZPUsWKdZjZ4G6LG3MqK2iXKdNba994F8W9ikA+qx2Eo3A==
version "3.6.7"
resolved "https://registry.yarnpkg.com/@types/mongodb/-/mongodb-3.6.7.tgz#b15300254083bc4c6b09036ccaaa75d2f9c6e35c"
integrity sha512-47P64kbkXarlleSMzSrRG04uzY+Dr3xAilOiqRIsqj/sZrmq6cUMx8njydY/iWMqi8IdE9ojFQl/X3ou9EsAlQ==
dependencies:
"@types/bson" "*"
"@types/node" "*"

"@types/node@*":
version "14.14.25"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.25.tgz#15967a7b577ff81383f9b888aa6705d43fbbae93"
integrity sha512-EPpXLOVqDvisVxtlbvzfyqSsFeQxltFbluZNRndIb8tr9KiBnYNLzrc1N3pyKUCww2RNrfHDViqDWWE1LCJQtQ==
version "14.14.26"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.26.tgz#e40df24c957568f350cca04e63bfb1e1556d1cbf"
integrity sha512-skWxepWOs+VArEBWd2S/VR3wUavioIIx9/HzW+UJiIjtwa6+kNXdsOeq7FfxDXf56hIcL0ieo2brwMgBJ1+lhw==

"@types/normalize-package-data@^2.4.0":
version "2.4.0"
Expand Down Expand Up @@ -372,9 +372,9 @@ ajv@^6.10.0, ajv@^6.12.4:
uri-js "^4.2.2"

ajv@^7.0.2:
version "7.0.4"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-7.0.4.tgz#827e5f5ae32f5e5c1637db61f253a112229b5e2f"
integrity sha512-xzzzaqgEQfmuhbhAoqjJ8T/1okb6gAzXn/eQRNpAN1AEUoHJTNF9xCDRTtf/s3SKldtZfa+RJeTs+BQq+eZ/sw==
version "7.1.0"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-7.1.0.tgz#f982ea7933dc7f1012eae9eec5a86687d805421b"
integrity sha512-svS9uILze/cXbH0z2myCK2Brqprx/+JJYK5pHicT/GQiBfzzhUVAIT6MwqJg8y4xV/zoGsUeuPuwtoiKSGE15g==
dependencies:
fast-deep-equal "^3.1.1"
json-schema-traverse "^1.0.0"
Expand Down Expand Up @@ -1305,7 +1305,7 @@ is-arrayish@^0.2.1:
resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d"
integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=

is-core-module@^2.1.0:
is-core-module@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.2.0.tgz#97037ef3d52224d85163f5597b2b63d9afed981a"
integrity sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==
Expand Down Expand Up @@ -1943,11 +1943,11 @@ [email protected], resolve-global@^1.0.0:
global-dirs "^0.1.1"

resolve@^1.10.0, resolve@^1.17.0:
version "1.19.0"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.19.0.tgz#1af5bf630409734a067cae29318aac7fa29a267c"
integrity sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==
version "1.20.0"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975"
integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==
dependencies:
is-core-module "^2.1.0"
is-core-module "^2.2.0"
path-parse "^1.0.6"

reusify@^1.0.4:
Expand Down Expand Up @@ -2331,10 +2331,10 @@ [email protected]:
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.3.tgz#d3ac8883a97c26139e42df5e93eeece33d610b8a"
integrity sha512-D/wqnB2xzNFIcoBG9FG8cXRDjiqSTbG2wd8DMZeQyJlP1vfTkIxH4GKveWaEBYySKIg+USu+E+EDIR47SqnaMQ==

typescript@^4.1.4:
version "4.1.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.4.tgz#f058636e2f4f83f94ddaae07b20fd5e14598432f"
integrity sha512-+Uru0t8qIRgjuCpiSPpfGuhHecMllk5Zsazj5LZvVsEStEjmIRRBZe+jHjGQvsgS7M1wONy2PQXd67EMyV6acg==
typescript@^4.1.5:
version "4.1.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.5.tgz#123a3b214aaff3be32926f0d8f1f6e704eb89a72"
integrity sha512-6OSu9PTIzmn9TCDiovULTnET6BgXtDYL4Gg4szY+cGsc3JP1dQL8qvE8kShTRx1NIw4Q9IBHlwODjkjWEtMUyA==

universalify@^2.0.0:
version "2.0.0"
Expand Down

1 comment on commit fe54b4b

@vercel
Copy link

@vercel vercel bot commented on fe54b4b Feb 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.