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: Add custom headers to requests #22

Closed
wants to merge 3 commits into from

Conversation

DarronEngelbrecht
Copy link

@DarronEngelbrecht DarronEngelbrecht commented May 24, 2024

This PR allows adding custom headers to the request through the headers method or PEST_STRESS_TEST_OPTIONS variable. We needed this for authentication.

You can use it like this...

$result = stress('example.com')->headers([
    'Authorization' => 'Bearer '. $this->bearerToken,
])

Added a test using reflection as I didn't want to create a getter just for testing.

@nunomaduro @nahime0 - This addresses issue #9 and can help address issue #20 but should probably be merged with PR #19

@ihorchepurnyi
Copy link

Hello, this is a super useful PR! Could you please clarify when you’ll be able to review or merge it?

@ihorchepurnyi
Copy link

@nunomaduro Could you please take a look? I’m just trying to understand if there are any blockers before merging

@devajmeireles
Copy link
Member

@DarronEngelbrecht Could you please rebase this to the 3.x branch?

@DarronEngelbrecht
Copy link
Author

@devajmeireles - Thanks for your work on Pest. Have cherry picked these commits to the 3.x branch and opened a second PR hope that works for you, https://github.com/pestphp/pest-plugin-stressless/pull/24/files

@devajmeireles
Copy link
Member

Closed in favor of #24

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.

3 participants