diff --git a/src/UrlResolver.php b/src/UrlResolver.php
index <HASH>..<HASH> 100644
--- a/src/UrlResolver.php
+++ b/src/UrlResolver.php
@@ -80,7 +80,7 @@ final class UrlResolver implements ResolverInterface
                 $originFolder = $this
                     ->parser
                     ->parseUrl((string) $origin)
-                    ->path;
+                    ->path ?? '/';
 
                 return (string) $origin->withPath(
                     (new Path($originFolder))
diff --git a/tests/UrlResolverTest.php b/tests/UrlResolverTest.php
index <HASH>..<HASH> 100644
--- a/tests/UrlResolverTest.php
+++ b/tests/UrlResolverTest.php
@@ -20,6 +20,13 @@ class UrlResolverTest extends TestCase
         $this->assertSame(
             'http://example.com/foo',
             $this->r->resolve(
+                'http://example.com',
+                'foo'
+            )
+        );
+        $this->assertSame(
+            'http://example.com/foo',
+            $this->r->resolve(
                 'http://example.com/bar',
                 'http://example.com/foo'
             )
fix resolving when no path defined in the origin