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: router to correct work with first / route and others #1123

Closed
wants to merge 1 commit into from

Conversation

dkatashev
Copy link

This PR fix the problem associated with the route / and rest routes.
In order to reproduce the problem, you can use the code below, which will cause the router /body to stop being called without this fix.

const connect = require('connect');

const app = connect();

app.use('/', (req, res, next) => {
    const { headers, method, body } = req;

    res.writeHead(200, { 'Content-Type': 'application/json' });
    res.end(JSON.stringify({ headers, method, body }, null, 2));

    next();
});

app.use('/body', (req, res, next) => {
    const { body } = req;

    res.writeHead(200, { 'Content-Type': 'application/json' });
    res.end(JSON.stringify({ body }, null, 2));

    next();
});

Copy link
Contributor

@dougwilson dougwilson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Can you add that as a test in our test suite? Also it looks like this may have broken something else based on the existing tests no longer passing. Can you fix that as well?

@dougwilson
Copy link
Contributor

Closing due to no response.

@dougwilson dougwilson closed this Apr 15, 2020
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.

None yet

2 participants