Skip to content

ext/curl: allow changing Caddy port for Server Push tests #13337

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions ext/curl/tests/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
auto_https disable_redirects
}

localhost
{$SERVER_NAME:https://localhost} {
respond / "Caddy is up and running"

respond / "Caddy is up and running"

# HTTP/2 Server Push
respond /serverpush "main response"
respond /serverpush/pushed "pushed response"
push /serverpush /serverpush/pushed
# HTTP/2 Server Push
respond /serverpush "main response"
respond /serverpush/pushed "pushed response"
push /serverpush /serverpush/pushed
}
2 changes: 1 addition & 1 deletion ext/curl/tests/bug76675.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ $mh = curl_multi_init();
curl_multi_setopt($mh, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX);
curl_multi_setopt($mh, CURLMOPT_PUSHFUNCTION, $callback);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://localhost/serverpush');
curl_setopt($ch, CURLOPT_URL, (getenv('SERVER_NAME') ?: 'https://localhost') . '/serverpush');
curl_setopt($ch, CURLOPT_HTTP_VERSION, 3);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
Expand Down
2 changes: 1 addition & 1 deletion ext/curl/tests/bug77535.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class MyHttpClient
curl_setopt($this->curl, CURLOPT_HEADER, false);
curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, false);
curl_setopt($this->curl, CURLOPT_FAILONERROR, false);
curl_setopt($this->curl, CURLOPT_URL, 'https://localhost/serverpush');
curl_setopt($this->curl, CURLOPT_URL, (getenv('SERVER_NAME') ?: 'https://localhost') . '/serverpush');
curl_setopt($this->curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
curl_setopt($this->curl, CURLOPT_HEADERFUNCTION, function ($ch, $data) {
return \strlen($data);
Expand Down
2 changes: 1 addition & 1 deletion ext/curl/tests/curl_pushfunction.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ curl_multi_setopt($mh, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX);
curl_multi_setopt($mh, CURLMOPT_PUSHFUNCTION, $callback);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://localhost/serverpush");
curl_setopt($ch, CURLOPT_URL, (getenv('SERVER_NAME') ?: 'https://localhost') . '/serverpush');
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ curl_multi_setopt($mh, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX);
curl_multi_setopt($mh, CURLMOPT_PUSHFUNCTION, "nonexistent");

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://localhost/serverpush");
curl_setopt($ch, CURLOPT_URL, (getenv('SERVER_NAME') ?: 'https://localhost') . '/serverpush');
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

Expand Down