@rip-lang/server 1.3.4 → 1.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/server.rip +3 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rip-lang/server",
3
- "version": "1.3.4",
3
+ "version": "1.3.6",
4
4
  "description": "Pure Rip web framework and application server",
5
5
  "type": "module",
6
6
  "main": "api.rip",
@@ -45,7 +45,7 @@
45
45
  "author": "Steve Shreeve <steve.shreeve@gmail.com>",
46
46
  "license": "MIT",
47
47
  "dependencies": {
48
- "rip-lang": ">=3.13.14"
48
+ "rip-lang": ">=3.13.15"
49
49
  },
50
50
  "files": [
51
51
  "api.rip",
package/server.rip CHANGED
@@ -121,7 +121,7 @@ logAccessHuman = (app, req, res, totalSeconds, workerSeconds) ->
121
121
  type = if contentType.includes('/') then contentType.split('/')[1] else contentType
122
122
  console.log "[#{timestamp} #{timezone} #{d1} #{d2}] #{method} #{path} → #{status} #{type} #{len}"
123
123
 
124
- INTERNAL_HEADERS = new Set(['rip-worker-busy', 'rip-worker-id'])
124
+ INTERNAL_HEADERS = new Set(['rip-worker-busy', 'rip-worker-id', 'rip-no-log'])
125
125
 
126
126
  stripInternalHeaders = (h) ->
127
127
  out = new Headers()
@@ -920,10 +920,11 @@ class Server
920
920
  logAccessHuman(@flags.appName, req, res, totalSeconds, workerSeconds)
921
921
 
922
922
  buildResponse: (res, req, start, workerSeconds) ->
923
+ silent = res.headers.get('rip-no-log') is '1'
923
924
  headers = stripInternalHeaders(res.headers)
924
925
  headers.delete('date')
925
926
  @maybeAddSecurityHeaders(headers)
926
- @logAccess(req, res, (performance.now() - start) / 1000, workerSeconds)
927
+ @logAccess(req, res, (performance.now() - start) / 1000, workerSeconds) unless silent
927
928
  new Response(res.body, { status: res.status, statusText: res.statusText, headers })
928
929
 
929
930
  forwardToWorker: (req, socket) ->