pixl-server-web 1.3.27 → 1.3.29

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.
package/README.md CHANGED
@@ -1094,6 +1094,7 @@ Here are descriptions of the data JSON properties:
1094
1094
  | Property | Type | Description |
1095
1095
  |----------|------|-------------|
1096
1096
  | `id` | String | The internal ID for the request. |
1097
+ | `method` | String | The HTTP method for the request, e.g. `GET`, `POST`. |
1097
1098
  | `proto` | String | The protocol of the request (`http` or `https`). |
1098
1099
  | `ip` | String | The first non-internal IP address (see [args.ip](#argsip)). |
1099
1100
  | `ips` | Array | All the client IPs as an array (includes those from proxy headers). |
@@ -1120,6 +1121,7 @@ If you set both the [http_log_requests](#http_log_requests) and [http_log_reques
1120
1121
  ```json
1121
1122
  {
1122
1123
  "id": "r10",
1124
+ "method": "POST",
1123
1125
  "proto": "http",
1124
1126
  "ip": "::1",
1125
1127
  "ips": [
@@ -1196,6 +1198,7 @@ As you can see, in addition to all the information logged with [http_log_request
1196
1198
  | Property | Type | Description |
1197
1199
  |----------|------|-------------|
1198
1200
  | `id` | String | The internal ID for the request. |
1201
+ | `method` | String | The HTTP method for the request, e.g. `GET`, `POST`. |
1199
1202
  | `proto` | String | The protocol of the request (`http` or `https`). |
1200
1203
  | `ip` | String | The first non-internal IP address (see [args.ip](#argsip)). |
1201
1204
  | `ips` | Array | All the client IPs as an array (includes those from proxy headers). |
@@ -1221,8 +1224,9 @@ The raw request and response content will only be logged in certain cases:
1221
1224
  - If the request was a form post, then the key/value pairs will be in the `params` object.
1222
1225
  - If the request contained file uploads, they will be summarized in the `files` object (see above for example).
1223
1226
  - If the response is recognized as text, it will be included in `response.raw` as a UTF-8 string.
1224
- - If the response is non-text (binary), the raw content will not be included.
1225
- - If the response is a stream, it will not be included.
1227
+ - If the response is non-text (binary), the raw content will not be logged.
1228
+ - If the response is pre-compressed by application code, it will not be logged.
1229
+ - If the response is a stream, it will not be logged.
1226
1230
 
1227
1231
  ## Performance Threshold Logging
1228
1232
 
package/lib/response.js CHANGED
@@ -104,7 +104,7 @@ module.exports = class Response {
104
104
 
105
105
  // copy stuff into args for detail logging
106
106
  if (this.logRequestDetails) {
107
- args.resp_body = body;
107
+ if (headers['Content-Encoding']) args.resp_body = Buffer.from("(Compressed)"); else args.resp_body = body;
108
108
  args.resp_headers = headers;
109
109
  }
110
110
 
@@ -330,6 +330,7 @@ module.exports = class Response {
330
330
  if (this.logRequests && args.request.url.match(this.regexLogRequests)) {
331
331
  var data = {
332
332
  id: args.id,
333
+ method: args.request.method,
333
334
  proto: args.request.headers['ssl'] ? 'https' : socket_data.proto,
334
335
  ip: args.ip,
335
336
  ips: args.ips,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixl-server-web",
3
- "version": "1.3.27",
3
+ "version": "1.3.29",
4
4
  "description": "A web server component for the pixl-server framework.",
5
5
  "author": "Joseph Huckaby <jhuckaby@gmail.com>",
6
6
  "homepage": "https://github.com/jhuckaby/pixl-server-web",