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

Set cookie path to URL of homepage #67

Merged
merged 2 commits into from
Dec 13, 2023
Merged

Conversation

mgax
Copy link
Contributor

@mgax mgax commented Dec 12, 2023

Fixes #46

@mgax mgax marked this pull request as ready for review December 12, 2023 11:30
Copy link
Contributor

@tomusher tomusher left a comment

Choose a reason for hiding this comment

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

Looks good to me. Are there any cases you can think of where the path of a root page is not /, or is this for future proofing?

@mgax
Copy link
Contributor Author

mgax commented Dec 13, 2023

Are there any cases you can think of where the path of a root page is not /, or is this for future proofing?

Future-proofing, in case somebody hosts a couple of Wagtail websites on the same domain. Though I'm wondering if the approach is right, because it introduces 2 database queries for each page load. Perhaps a better approach is to pass a site argument to the inclusion tag, and only if that's present, compute the homepage's URL, otherwise just use /?

@mgax mgax marked this pull request as draft December 13, 2023 12:05
Copy link

codecov bot commented Dec 13, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (31909a4) 87.84% compared to head (d84e76f) 87.84%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #67   +/-   ##
=======================================
  Coverage   87.84%   87.84%           
=======================================
  Files          15       15           
  Lines         732      732           
  Branches      137      137           
=======================================
  Hits          643      643           
  Misses         54       54           
  Partials       35       35           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This avoids two extra database queries on every page load.
@mgax mgax marked this pull request as ready for review December 13, 2023 13:47
@mgax mgax requested a review from tomusher December 13, 2023 13:47
Copy link
Contributor

@tomusher tomusher left a comment

Choose a reason for hiding this comment

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

Great, that change makes sense to me!

Copy link
Member

@Stormheg Stormheg left a comment

Choose a reason for hiding this comment

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

Thank you! Just setting this to the root path sounds fine to me.

@Stormheg Stormheg merged commit fbeed50 into wagtail-nest:main Dec 13, 2023
10 checks passed
@mgax mgax deleted the fix-cookie-path branch December 14, 2023 13:57
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.

conversions don't get tracked
3 participants