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

[#545] Fixes => content-length request header is removed when parse… #549

Merged
merged 1 commit into from
Aug 20, 2024

Conversation

monkpow
Copy link
Collaborator

@monkpow monkpow commented Aug 20, 2024

…ReqBody is false.

@monkpow
Copy link
Collaborator Author

monkpow commented Aug 20, 2024

This fixes the issue raised in #545 and adds tests to confirm the behavior.

However, when testing this solution I found the following test does not pass:

-      it.only('when the author uses a proxyReqDecorator', function (done) {
-        var app = express();
-        app.use(proxy('localhost:8109', {
-          proxyReqBodyDecorator: function() {
-            return 'hey man';
-          }
-        }));
-
-        request(app)
-          .post('/headers')
-          .send({
-            data: 'random string of words'
-          })
-          .set('Content-Type', 'application/json')
-          .set('Accept', 'application/json')
-          .end(function (err, res) {
-            if (err) { throw err; }
-            assert(res.body.headers['content-length']);
-            const contentLength = res.body.headers['content-length'];
-            assert.equal(contentLength, 18);
-            done(err);
-          });
-      });
-

I suspect this was already true, but I'm raising an additional issue to investigate the test above.

@monkpow
Copy link
Collaborator Author

monkpow commented Aug 20, 2024

I created an issue (#550) to capture the case I discovered. That test is in the same state on the main line, so I'm going to separate these two tickets, and move this one to resolution.

@monkpow monkpow marked this pull request as ready for review August 20, 2024 00:53
@monkpow monkpow merged commit 0f1a486 into master Aug 20, 2024
3 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.

1 participant