Don't send Link header when don't know prev and next links (#4633)

This commit is contained in:
Yamagishi Kazutoshi
2017-08-18 17:42:59 +09:00
committed by Eugen Rochko
parent 4edf9d849f
commit 2edfdab6e6
2 changed files with 2 additions and 3 deletions

View File

@ -43,7 +43,7 @@ class Api::BaseController < ApplicationController
links = []
links << [next_path, [%w(rel next)]] if next_path
links << [prev_path, [%w(rel prev)]] if prev_path
response.headers['Link'] = LinkHeader.new(links)
response.headers['Link'] = LinkHeader.new(links) unless links.empty?
end
def limit_param(default_limit)