Skip to content

Commit

Permalink
Merge pull request #61 from ba-st/links-base-url
Browse files Browse the repository at this point in the history
Added support for creating a url based on the authority of another.
  • Loading branch information
gcotelli authored Oct 3, 2019
2 parents 3a0fd10 + 41ffb0a commit 3e748b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion source/Stargate-Examples/PetsRESTfulController.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ PetsRESTfulController >> getPetsBasedOn: httpRequest within: requestContext [
end := pagination end min: total.
self
addPaginationControlsTo: requestContext
basedOn: httpRequest absoluteUrl
basedOn: ( httpRequest absoluteUrl asHostedAt: requestHandler resourceLocator baseUrl )
start: start
limit: pagination limit
end: end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,11 @@ HypermediaDrivenRESTfulRequestHandler >> encodeResourceCollection: resourceColle
requestContext
holdAsHypermediaControls:
( self paginationPolicy
addPaginationControlsTo: ( Array with: 'self' -> httpRequest absoluteUrl )
addPaginationControlsTo:
( Array with: 'self' -> ( httpRequest absoluteUrl asHostedAt: self resourceLocator baseUrl ) )
within: requestContext )
for: resourceCollection.

resourceCollection do: [ :resource | self holdResource: resource controlsWithin: requestContext ].

^ super
encodeResourceCollection: ( ResourceCollection wrapping: resourceCollection )
to: mediaType
Expand Down

0 comments on commit 3e748b9

Please sign in to comment.