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

feat(node.js fetch): #1268 implement redirect for fetch #1271

Merged

Conversation

syamsudotdev
Copy link
Contributor

@syamsudotdev syamsudotdev commented Apr 14, 2024

Monika Pull Request (PR)

This PR resolves #1268

What feature/issue does this PR add

  1. Handle HTTP status code 3xx for Node.js fetch implementation

How did you implement / how did you fix it

  1. Manually handle status code 3xx on Node.js fetch function
  2. Move HTTP client's dependency to flag to parameter function
  3. Add tests

How to test

  1. npm run test
  2. Create monika.yml config file below
probes:
  - id: 'Example'
    requests:
      - url: https://httpbin.org/redirect/3
        timeout: 60000
    interval: 5
    incidentThreshold: 1
    recoveryThreshold: 1
    alerts:
      - assertion: response.time >= 60000
        message: HTTP response time is {{ response.time }}, expecting 10000
  1. npm run start -- --native-fetch -c monika.yml -r 1

@syamsudotdev syamsudotdev merged commit f05e7cb into hyperjumptech:main Apr 16, 2024
7 checks passed
@syamsudotdev syamsudotdev deleted the feat/1268-fetch-redirect branch April 16, 2024 06:25
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.

Node.js fetch : handle HTTP status code 3xx to comply with --follow-redirects flag
3 participants