Skip to content

Commit

Permalink
SharePoint API: service root url fix for web resource
Browse files Browse the repository at this point in the history
  • Loading branch information
vgrem committed Jul 15, 2023
1 parent a21177f commit 5146bbb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/SharePoint/Web.php
Original file line number Diff line number Diff line change
Expand Up @@ -2140,8 +2140,8 @@ public function getResourceUrl()
if (!is_null($this->webUrl)) {
$urlInfo = parse_url($this->getContext()->getBaseUrl());
$rootSiteUrl = $urlInfo['scheme'] . '://' . $urlInfo['host'];
return "{$rootSiteUrl}{$this->webUrl}/_api/web";
#return str_replace("/_api", "{$this->webUrl}/_api", $url);
$webPath = str_replace($rootSiteUrl, "", $this->getContext()->getBaseUrl());
return str_replace("{$webPath}/_api", "{$this->webUrl}/_api", $url);
}
return $url;
}
Expand Down

0 comments on commit 5146bbb

Please sign in to comment.