Compare commits

...
8 Commits
3 changed files with 13 additions and 6 deletions
+2 -2
View File
@@ -16,9 +16,9 @@ USER safeuser
# Clone the repository
WORKDIR /home/safeuser
RUN git clone https://github.com/christroutner/bch-api
RUN git clone https://github.com/Permissionless-Software-Foundation/bch-api
WORKDIR /home/safeuser/bch-api
RUN npm install
RUN npm install --silent
# Generate documentation
RUN npm run docs
+2 -2
View File
@@ -13,9 +13,9 @@ USER safeuser
# Clone the repository
WORKDIR /home/safeuser
RUN git clone https://github.com/christroutner/bch-api
RUN git clone https://github.com/Permissionless-Software-Foundation/bch-api
WORKDIR /home/safeuser/bch-api
RUN npm install
RUN npm install --silent
# Generate documentation
RUN npm run docs
+9 -2
View File
@@ -116,13 +116,20 @@ class RateLimits {
let pointsToConsume = _this.calcPoints(decoded)
res.locals.pointsToConsume = pointsToConsume // Feedback for tests.
// Retrieve the origin.
let origin = req.get('origin')
if (origin === undefined && key.indexOf('10.0.0.5') > -1) {
origin = 'slp-api'
}
wlogger.info(`origin: ${origin}`)
// If the request originates from one of the approved wallet apps, then
// apply paid-access rate limits.
const origin = req.get('origin')
if (
origin &&
(origin.toString().indexOf('wallet.fullstack.cash') > -1 ||
origin.toString().indexOf('sandbox.fullstack.cash') > -1)
origin.toString().indexOf('sandbox.fullstack.cash') > -1 ||
origin === 'slp-api')
) {
pointsToConsume = 1
res.locals.pointsToConsume = pointsToConsume // Feedback for tests.