Looks like we are hoping the request.full_path is good by default for returning. However I've found some libraries and especially calls from swagger ui will escape query strings. This means when we are creating links they'll come in their escaped form into the response:
"links": {
"self": "http://localhost:3000/api/bundles?page%5Bnumber%5D=2",
"current": "http://localhost:3000/api/bundles?page[number]=2",
"first": "http://localhost:3000/api/bundles?page[number]=1",
"prev": "http://localhost:3000/api/bundles?page[number]=1"
}
This appears to only be present in the pagination and could be corrected by just wrapping it in a CGI.unescape block.
# Generates the pagination links
#
# @return [Array]
def jsonapi_pagination(resources)
links = { self: request.base_url + CGI.unescape(request.fullpath) }
pagination = jsonapi_pagination_meta(resources)
Before opening a PR, is there a specific reason we wouldn't want to CGI.unescape a path here?
Looks like we are hoping the
request.full_pathis good by default for returning. However I've found some libraries and especially calls from swagger ui will escape query strings. This means when we are creating links they'll come in their escaped form into the response:This appears to only be present in the pagination and could be corrected by just wrapping it in a
CGI.unescapeblock.Before opening a PR, is there a specific reason we wouldn't want to CGI.unescape a path here?