Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: response.length always zero #26

Merged
merged 1 commit into from
Apr 13, 2024
Merged

Conversation

wobondar
Copy link
Contributor

@wobondar wobondar commented Apr 12, 2024

Fixes #27 response.length value is always 0

Before:

{
  "time": "2024-04-12T18:53:18.421Z",
  "level": "INFO",
  "msg": "Incoming request",
  "request": {
    "time": "2024-04-12T18:53:18.421Z",
    "method": "POST",
    "host": "localhost:5001",
    "path": "/test",
    "query": "",
    "params": {},
    "route": "/test",
    "ip": "127.0.0.1",
    "referer": "",
    "length": 0
  },
  "response": {
    "time": "2024-04-12T18:53:18.421Z",
    "latency": 81333,
    "status": 200,
    "length": 0, <=== Invalid value
    "body": "{\"name\":\"John Doe\",\"email\":\"[email protected]\"}\n"
  }
}

After:

{
  "time": "2024-04-12T18:55:58.451Z",
  "level": "INFO",
  "msg": "Incoming request",
  "request": {
    "time": "2024-04-12T18:55:58.451Z",
    "method": "POST",
    "host": "localhost:5001",
    "path": "/test",
    "query": "",
    "params": {},
    "route": "/test",
    "ip": "127.0.0.1",
    "referer": "",
    "length": 0
  },
  "response": {
    "time": "2024-04-12T18:55:58.451Z",
    "latency": 81333,
    "status": 200,
    "length": 48, <=== Correct value
    "body": "{\"name\":\"John Doe\",\"email\":\"[email protected]\"}\n"
  }
}

@samber samber merged commit 6632ef0 into samber:main Apr 13, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Response length value always 0
2 participants