@php-wasm/universal 3.0.21 → 3.0.22

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/index.js CHANGED
@@ -2617,7 +2617,7 @@ class PHPRequestHandler {
2617
2617
  * @param request - PHP Request data.
2618
2618
  */
2619
2619
  async request(e) {
2620
- const r = URL.canParse(e.url), s = new URL(
2620
+ const r = looksLikeAbsoluteUrl(e.url), s = new URL(
2621
2621
  // Remove the hash part of the URL as it's not meant for the server.
2622
2622
  e.url.split("#")[0],
2623
2623
  r ? void 0 : DEFAULT_BASE_URL
@@ -2914,6 +2914,13 @@ function applyRewriteRules(t, e) {
2914
2914
  }
2915
2915
  return t;
2916
2916
  }
2917
+ function looksLikeAbsoluteUrl(t) {
2918
+ try {
2919
+ return new URL(t), !0;
2920
+ } catch {
2921
+ return !1;
2922
+ }
2923
+ }
2917
2924
  function rotatePHPRuntime({
2918
2925
  php: t,
2919
2926
  recreateRuntime: e,