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

Introduce dynamic random numbers support in HTTP requests #226

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

artemmukhin
Copy link
Contributor

Now it is possible to inject randomized numbers into HTTP requests. Specifically, the $DYNAMIC_RANDOM_NUMBER placeholders in the request URL or body will be substituted with actual random values. The range for these numbers can be configured using the RANDOM_MIN and RANDOM_MAX environment variables, which default to 0 and 1000000, respectively.

Discussion: upptime/upptime#857

Copy link
Member

@AnandChowdhary AnandChowdhary left a comment

Choose a reason for hiding this comment

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

Some small notes :)

src/update.ts Show resolved Hide resolved
src/helpers/environment.ts Outdated Show resolved Hide resolved
@AnandChowdhary
Copy link
Member

Looks great, you did an amazing job! Would you also like to add support for the following?

  • $DYNAMIC_ALPHANUMERIC_STRING
  • $DYNAMIC_CURRENT_ISO_TIME
  • $DYNAMIC_CURRENT_UNIX_TIMESTAMP

Then we're feature complete with your request! :)

Now it is possible to inject randomized numbers into HTTP requests. Specifically, the `$DYNAMIC_RANDOM_NUMBER` placeholders in the request URL or body will be substituted with actual random values. The range for these numbers can be configured using the `RANDOM_MIN` and `RANDOM_MAX` environment variables, which default to `0` and `1000000`, respectively.

Discussion: upptime/upptime#857
@artemmukhin
Copy link
Contributor Author

Thanks for the prompt feedback! I'd like to extend this functionality in the next PR.

@AnandChowdhary AnandChowdhary merged commit 08b4cb9 into upptime:master Oct 4, 2023
@AnandChowdhary
Copy link
Member

Thank you for a fantastic job!

@upptime-bot
Copy link
Member

🎉 This PR is included in version 1.32.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@artemmukhin
Copy link
Contributor Author

Follow-up #227

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants