Skip to content

Conversation

@maxisam
Copy link
Contributor

@maxisam maxisam commented Aug 23, 2024

this should fix #1743 #1720

@nx-cloud
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.

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