Sha256: 1a5d520957237751c5b68de2953c81069a81e844e42b5074bc7cfe4ba0ff7979

Contents?: true

Size: 476 Bytes

Versions: 9

Compression:

Stored size: 476 Bytes

Contents

# frozen_string_literal: true

module Nonnative
  class Header
    class << self
      def http_user_agent(user_agent)
        { user_agent: }
      end

      def grpc_user_agent(user_agent)
        { 'grpc.primary_user_agent' => user_agent }
      end

      def auth_basic(credentials)
        { authorization: "Basic #{Base64.strict_encode64(credentials)}" }
      end

      def auth_bearer(token)
        { authorization: "Bearer #{token}" }
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
nonnative-1.83.0 lib/nonnative/header.rb
nonnative-1.82.0 lib/nonnative/header.rb
nonnative-1.81.0 lib/nonnative/header.rb
nonnative-1.80.0 lib/nonnative/header.rb
nonnative-1.79.0 lib/nonnative/header.rb
nonnative-1.78.0 lib/nonnative/header.rb
nonnative-1.77.0 lib/nonnative/header.rb
nonnative-1.76.0 lib/nonnative/header.rb
nonnative-1.75.0 lib/nonnative/header.rb