Skip to content

Commit

Permalink
fix: replacing params
Browse files Browse the repository at this point in the history
  • Loading branch information
tpluscode committed Jan 15, 2025
1 parent e210c2a commit 856cf5e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/hydra/lib/iriTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ export function fromQuery(rdf: Environment<DataFactory | ClownfaceFactory>, quer
export function applyTemplate(resource: GraphPointer, expanded: string) {
let url = new URL(resource.value)

if (expanded.startsWith('?') || expanded.startsWith('$')) {
if (expanded.startsWith('?') || expanded.startsWith('&')) {
const searchParams = new URLSearchParams(expanded)
for (const [param, value] of searchParams) {
url.searchParams.append(param, value)
url.searchParams.set(param, value)
}
} else {
url = new URL(expanded, url)
Expand Down

0 comments on commit 856cf5e

Please sign in to comment.