We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When using relative URLs, it creates errors.
The patch could be quite simple, something like that :
diff --git a/src/Middleware/AddHttp2ServerPush.php b/src/Middleware/AddHttp2ServerPush.php index 253cf28..adb94d8 100644 --- a/src/Middleware/AddHttp2ServerPush.php +++ b/src/Middleware/AddHttp2ServerPush.php @@ -115,7 +115,9 @@ class AddHttp2ServerPush $type = collect($linkTypeMap)->first(function ($type, $extension) use ($url) { return str_contains(strtoupper($url), $extension); }); - + if(!preg_match('%^https?://%i', $url)) { + $basePath = config('http2serverpush.base_path', '/'); + $url = $basePath . ltrim($url, $basePath); + } return is_null($type) ? null : "<{$url}>; rel=preload; as={$type}"; }
But it would require a config file... In my case, base path is always '/'. But it could be any other path...
The text was updated successfully, but these errors were encountered:
- Add config file
5f890d0
- Add size limit - Add base path configuration - Add exceptions filters - Update test - Updates doc solves JacobBennett#23, JacobBennett#27
Config file for : Size limit, exceptions, base path (#28)
a03e7ac
* #25 deduplicate header links * - Add config file - Add size limit - Add base path configuration - Add exceptions filters - Update test - Updates doc solves #23, #27 * update travis : - remove PHP5.6, - add PHP7.2 and 7.3
No branches or pull requests
When using relative URLs, it creates errors.
The patch could be quite simple, something like that :
But it would require a config file...
In my case, base path is always '/'. But it could be any other path...
The text was updated successfully, but these errors were encountered: