vite-plugin-php 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -118,7 +118,8 @@ function usePHP(cfg = {}) {
118
118
  configureServer(server) {
119
119
  server.middlewares.use(async (req, res, next) => {
120
120
  if (req.url) {
121
- let requestUrl = req.url;
121
+ const url = new URL(req.url, "http://localhost");
122
+ let requestUrl = url.pathname;
122
123
  if (requestUrl.endsWith("/")) {
123
124
  requestUrl += "index.php";
124
125
  }
package/dist/index.mjs CHANGED
@@ -116,7 +116,8 @@ function usePHP(cfg = {}) {
116
116
  configureServer(server) {
117
117
  server.middlewares.use(async (req, res, next) => {
118
118
  if (req.url) {
119
- let requestUrl = req.url;
119
+ const url = new URL(req.url, "http://localhost");
120
+ let requestUrl = url.pathname;
120
121
  if (requestUrl.endsWith("/")) {
121
122
  requestUrl += "index.php";
122
123
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-php",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "Precompile PHP-files with the speed of Vite",
5
5
  "keywords": [
6
6
  "vite",