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

isConnectionSecure() is duplicate code from @fastify/cookie/plugin.js #228

Closed
2 tasks done
U-4-E-A opened this issue Dec 7, 2023 · 2 comments
Closed
2 tasks done

Comments

@U-4-E-A
Copy link

U-4-E-A commented Dec 7, 2023

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the issue has not already been raised

Issue

I am currently reworking the session package and noticed that isConnectionSecure() is duplicated from @fastify/cookie/plugin.js. I want to keep my code D.R.Y. but it is not available as export from the cookie package.

This could be added as an export from the cookie package or a better solution (as this is a test on the Request object) might be to add it as an exported function in the main fastify package. This will centralise the code, avoid W.E.T. and also allow me to delete the function in my own package and simply import it from the main fastify package instead. Thanks.

@mcollina
Copy link
Member

mcollina commented Dec 7, 2023

Sure thing, could you send a PR?

@gurgunday
Copy link
Member

Closed by #238

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

No branches or pull requests

3 participants