Skip to content

Commit 5146bbb

Browse files
committed
SharePoint API: service root url fix for web resource
1 parent a21177f commit 5146bbb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/SharePoint/Web.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2140,8 +2140,8 @@ public function getResourceUrl()
21402140
if (!is_null($this->webUrl)) {
21412141
$urlInfo = parse_url($this->getContext()->getBaseUrl());
21422142
$rootSiteUrl = $urlInfo['scheme'] . '://' . $urlInfo['host'];
2143-
return "{$rootSiteUrl}{$this->webUrl}/_api/web";
2144-
#return str_replace("/_api", "{$this->webUrl}/_api", $url);
2143+
$webPath = str_replace($rootSiteUrl, "", $this->getContext()->getBaseUrl());
2144+
return str_replace("{$webPath}/_api", "{$this->webUrl}/_api", $url);
21452145
}
21462146
return $url;
21472147
}

0 commit comments

Comments
 (0)