Open JorgenEvens opened 8 years ago
Maybe this needs a different fix, as I just discovered that links which do not have a leading /
also suffer from this problem.
hal: {
links: {
keys: 'keys',
values: 'values'
}
}
Results in
{
"_links": {
"self": {
"href": "http://localhost:5000/items"
},
"keys": {
"href": "keys"
},
"values": {
"href": "values"
}
}
}
Would the inverse of https://github.com/bleupen/halacious/blob/master/lib/plugin.js#L632 do the job?
When configuring links that are relative to the root of the webserver in combination with the
absolute=true
plugin option causes non-absolute links to be generated.I think the problem lies in the
isRelativePath
check, which should also consider paths relative to the server root as relative.Example:
Will currently return the following, note that the
href
forkeys
andvalues
are not absolute.