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

Mock-Server does not update Content-Length header when overriding response body with httpOverrideForwardedRequest #914

Closed
ReneFerwerda opened this issue Nov 6, 2020 · 0 comments

Comments

@ReneFerwerda
Copy link

In our test environment we use the httpOverrideForwardedRequest. When overriding the HTTP response body here in MockServer, mockserver does not update the content-length header.

As a result of this, the user needs to manually find out how MockServer will return the response (as there is a difference in how JSON is sent). It would be really nice and user friendly to automatically update the content-length header when overriding the response body.

"httpOverrideForwardedRequest": {
  "httpRequest": {
  "path": "/api/ForwardToHere",
  "socketAddress": {
    "host": "localhost",
    "port": 5000,
    "scheme": "HTTP"
    }
  },
  "httpResponse": {
    "headers": {
      "content-Length": [ "39" ]
    },
    "body": [
      {
        "FirstName": "John",
        "LastName": "Doe"
      }
    ]
  }
}
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

No branches or pull requests

2 participants