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

Fixes request params incorrectly return #46

Merged
merged 1 commit into from Mar 3, 2020
Merged

Fixes request params incorrectly return #46

merged 1 commit into from Mar 3, 2020

Conversation

hehehai
Copy link
Contributor

@hehehai hehehai commented Mar 3, 2020

@kettanaito
Copy link
Member

Awesome! Welcome to contributors! 🎉

@kettanaito kettanaito merged commit 771897b into mswjs:master Mar 3, 2020
@kettanaito kettanaito assigned kettanaito and hehehai and unassigned kettanaito Mar 3, 2020
@kettanaito kettanaito self-requested a review March 3, 2020 13:12
@hehehai
Copy link
Contributor Author

hehehai commented Mar 3, 2020

Thanks, this is my first pr on github, this is great!

@kettanaito
Copy link
Member

@hehehai way to go! It's been a pleasure discussing things with you.
If you've got a wish to continue, I'd appreciate your feedback on #39. There's also a #21 to do, which shouldn't be difficult after some short discussion. Anyways, much thanks!

@hehehai
Copy link
Contributor Author

hehehai commented Mar 4, 2020

const params = relevantRequestHandler.mask
	? matchPath(req.url, { path: relevantRequestHandler.mask }).params
    : {}

const requestWithParams = {
    ...req,
    params,
}

@kettanaito Sorry, I am too entangled in the assignment, it will be clearer to take out the params directly from the match.

There is no type error

@kettanaito
Copy link
Member

@hehehai, hm. Well, it seems that full match is not used for anything but parameters, so go ahead, sounds reasonable to me. Could you please raise an issue about this suggestion first? 🙏

@hehehai
Copy link
Contributor Author

hehehai commented Mar 4, 2020

@kettanaito ok

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.

"req.params" does not contain my URL path parameter
2 participants