1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
# frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2025, by Samuel Williams.
require_relative "split"
module Protocol
module HTTP
module Header
# Represents generic or custom headers that can be used in trailers.
#
# This class is used as the default policy for headers not explicitly defined in the POLICY hash.
#
# It allows generic headers to be used in HTTP trailers, which is important for:
# - Custom application headers.
# - gRPC status headers (grpc-status, grpc-message).
# - Headers used by proxies and middleware.
# - Future HTTP extensions.
class Generic < Split
# Whether this header is acceptable in HTTP trailers.
# Generic headers are allowed in trailers by default to support extensibility.
# @returns [Boolean] `true`, generic headers are allowed in trailers.
def self.trailer?
true
end
end
end
end
end
|