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

Add workaround for loopback #643

Merged
merged 5 commits into from
Aug 9, 2019
Merged

Add workaround for loopback #643

merged 5 commits into from
Aug 9, 2019

Conversation

rishabh
Copy link
Contributor

@rishabh rishabh commented Aug 7, 2019

What does this PR do?

This PR adds a workaround to support the loopback library. Since loopback tries to find the express layers by comparing handler functions, it can't find the layers since we wrap the handlers. This causes the router stack to be filled with entries that are un-sortable. This is an issue because adding a new layer will cause the layer to be put at the bottom of the stack, below the raiseUrlNotFoundError layer, even after sorting. That means requests will throw a 404 error even though the route is properly registered.

This PR makes use of loopback's aggressive search for the original handle function by adding a reference to the original handle function.

Motivation

Support loopback.

@rishabh rishabh added enhancement New feature or request do-not-merge/WIP labels Aug 7, 2019
@rishabh rishabh requested a review from a team as a code owner August 7, 2019 18:11
@rochdev rochdev added this to the 0.15.0 milestone Aug 9, 2019
@rishabh rishabh merged commit 12f3dd8 into master Aug 9, 2019
@rishabh rishabh deleted the rish/loopback-workaround branch August 9, 2019 15:26
rochdev pushed a commit that referenced this pull request Aug 26, 2019
* Add reference to original handler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request integrations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants