Skip to content

Commit

Permalink
allow get API requests without any VPN check (#127)
Browse files Browse the repository at this point in the history
* test if path is being ignored

* test deploy 2

* allow get requests

* remove console.logs
  • Loading branch information
nikkaroraa authored Feb 28, 2024
1 parent 06236f6 commit 220f4ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
7 changes: 0 additions & 7 deletions container/CrabV2/Auction/Admin/AdminBidView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,6 @@ const AdminBidView: React.FC = () => {
setFilteredBids(_filteredBids)
const { clearingPrice: _clPrice } = getTxBidsAndClearingPrice(_filteredBids)
setClearingPrice(_clPrice)

console.log('Approvals:', JSON.stringify(approvalMap, null, 2))
console.log('Balances:', JSON.stringify(balanceMap, null, 2))
console.log('Auction:', JSON.stringify(auction, null, 2))
console.log('Bids:', JSON.stringify(bids, null, 2))
console.log('Filtered Bids:', JSON.stringify(_filteredBids, null, 2))
console.log('Clearing Price:', _clPrice.toString())
} catch (e) {
console.log(e)
}
Expand Down
6 changes: 5 additions & 1 deletion server/middlewares/restrict-access.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ export const restrictAccessMiddleware: Middleware = async (request, response, ne
// this is done as a preventive measure so as to not hit the request limit of redis
const isRequestFromAllowedReferer =
referer && (ALLOWED_REFERERS.includes(referer) || ALLOWED_REFERER_PATTERN.test(referer))
if (isRequestFromAllowedReferer) {

const requestType = request.method

// allow GET requests and requests from allowed referers
if (requestType === 'GET' || isRequestFromAllowedReferer) {
await next()
return
}
Expand Down

0 comments on commit 220f4ef

Please sign in to comment.