Skip to content

Commit

Permalink
Enable cors for local/testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
toshiSat committed Jan 17, 2024
1 parent e9edfcd commit ff39410
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions scripts/genesis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ if [ ! -f ~/.arkeo/config/genesis.json ]; then

add_claim_records "ARKEO" "$BOB" 1000000000000000 1000000000000000 1000000000000000 true
add_claim_records "ETHEREUM" "0x92E14917A0508Eb56C90C90619f5F9Adbf49f47d" 5000000000000000 1000000000000000 1000000000000000 true

# enable CORs on testnet/localnet
sed -i 's/enabled-unsafe-cors = false/enabled-unsafe-cors = true/g' ~/.arkeo/config/app.toml

fi

sed -i 's/"stake"/"uarkeo"/g' ~/.arkeo/config/genesis.json
Expand Down
4 changes: 2 additions & 2 deletions sentinel/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func (p Proxy) auth(next http.Handler) http.Handler {
}
ser, err := common.NewService(serviceName)
if err != nil || ser != contract.Service {
http.Error(w, fmt.Sprintf("contract service doesn't match the serivce name in the path: (%d/%d)", ser, contract.Service), http.StatusUnauthorized)
http.Error(w, fmt.Sprintf("contract service doesn't match the service name in the path: (%d/%d)", ser, contract.Service), http.StatusUnauthorized)
return
}

Expand Down Expand Up @@ -338,7 +338,7 @@ func (p Proxy) paidTier(aa ArkAuth, remoteAddr string) (code int, err error) {
}

if ok := p.isRateLimited(contract.Id, key, int(contract.QueriesPerMinute)); ok {
return http.StatusTooManyRequests, fmt.Errorf("client is ratelimited," + http.StatusText(429))
return http.StatusTooManyRequests, fmt.Errorf("client is rate limited," + http.StatusText(429))
}

claim.Nonce = aa.Nonce
Expand Down

0 comments on commit ff39410

Please sign in to comment.