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

Support for accessing req and res plumber objects inside porcelain endpoints #39

Open
hillalex opened this issue Aug 28, 2024 · 3 comments · May be fixed by #40
Open

Support for accessing req and res plumber objects inside porcelain endpoints #39

hillalex opened this issue Aug 28, 2024 · 3 comments · May be fixed by #40

Comments

@hillalex
Copy link
Contributor

hillalex commented Aug 28, 2024

Given an instance of porcelain_endpoint, the plumber request handler that is run under the hood does not pass the entire plumber request to the endpoint handler, but rather extracts just the path args, query parameters and body and passes them along.

But sometimes it is useful to have access to the whole req object; for example, if using the plumber session_cookie hook to attach sessions to the request (available at req$session).

We could try and identify the extra parts of the request that a user might want and add them individally, as per the path args, query strings and body, but a simplier and more flexible solution would just be to allow porcelain endpoint handlers to optionally accept a req argument.

@hillalex hillalex linked a pull request Aug 28, 2024 that will close this issue
@hillalex
Copy link
Contributor Author

@richfitz I've opened a PR adding this functionality #40 - would you be happy to accept this change?

@richfitz
Copy link
Member

OMG sorry I missed the original issue entirely (though tbf I was on Lundy at the time I think!)

@hillalex
Copy link
Contributor Author

hillalex commented Nov 4, 2024

No worries! I've been using porcelain via a fork, but would be great to get this in...

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 a pull request may close this issue.

2 participants