FIX: correctly uses request_uri to generate load_more_url (#19680)

Before this change we were generating an incorrect absolute URL: `https://chat/api/channels...`
This commit is contained in:
Joffrey JAFFEUX
2023-01-03 00:19:13 +01:00
committed by GitHub
parent 96e2d92129
commit d8a19b2c9a
2 changed files with 12 additions and 1 deletions

View File

@ -23,7 +23,7 @@ class Chat::Api::ChatChannelsController < Chat::Api
end
load_more_params = options.merge(offset: options[:offset] + options[:limit]).to_query
load_more_url = URI::HTTP.build(path: "/chat/api/channels", query: load_more_params)
load_more_url = URI::HTTP.build(path: "/chat/api/channels", query: load_more_params).request_uri
render json: serialized_channels, root: "channels", meta: { load_more_url: load_more_url }
end