Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(isr): add allowed query params options #1743 #1757

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

Merged
merged 6 commits into from
Aug 31, 2024

Conversation

maxisam
Copy link
Contributor

@maxisam maxisam commented Aug 23, 2024

this should fix #1743 #1720

Copy link

nx-cloud bot commented Aug 23, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 3ab8d52. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

πŸ“‚ See all runs for this CI Pipeline Execution


βœ… Successfully ran 7 targets

Sent with πŸ’Œ from NxCloud.

@eneajaho
Copy link
Member

Hi @maxisam
Thanks for doing this. I'd also like to have some docs for it, in order to showcase this new feature πŸ™Œ

@maxisam
Copy link
Contributor Author

maxisam commented Aug 24, 2024

sure, not sure where should I put this. I did put some doc in the comments with the config

@github-actions github-actions bot added the πŸ“š Docs Web Documentation hosted on github pages label Aug 28, 2024
@maxisam
Copy link
Contributor Author

maxisam commented Aug 28, 2024

@eneajaho Thanks for the review, could you rerun the build?

@maxisam
Copy link
Contributor Author

maxisam commented Aug 29, 2024

@eneajaho everything is green πŸŽ‰

});

it('should include only allowed query parameters in the result', () => {
const url = '/page?allowed=value&disallowed=value';
Copy link

Choose a reason for hiding this comment

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

since penetration tests would still try weird things, what would be with the cases:

  • `const url = '/page?allowed=value&disallowed=value&allowed=value2';
  • `const url = '/page?allowed=value&disallowed=value&allowed=value';

Copy link

Choose a reason for hiding this comment

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

btw @maxisam thx for the great work! πŸ™

Copy link
Contributor Author

@maxisam maxisam Aug 30, 2024

Choose a reason for hiding this comment

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

ummm, the current behavior is simply just removing disallowed parts and keep all allowed parts

so they will be

  • `const url = '/page?allowed=value&allowed=value2';
  • `const url = '/page?allowed=value&allowed=value';

I guess we can override the duplicated one ?

so we should make it like

  • `const url = '/page?allowed=value2';
  • `const url = '/page?allowed=value';

another thought is I actually want to make the getCacheKey like a pluggable function.

so everyone can have their own cacheKey.

@eneajaho how do you think about pluggable cacheKey function?

Copy link
Member

Choose a reason for hiding this comment

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

@maxisam Yeah we can make the cacheKey function pluggable, good idea.

Copy link
Member

Choose a reason for hiding this comment

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

Let's add it in another PR. Just merged this one.

@eneajaho eneajaho merged commit 5af9ab2 into rx-angular:main Aug 31, 2024
11 checks passed
@maxisam maxisam deleted the feat/query-params branch September 3, 2024 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
πŸ“š Docs Web Documentation hosted on github pages πŸš€ ISR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ISR: Avoiding immense cache-keys generation (Adding the possibility of defining a custom cacheKey)
3 participants