Sha256: 5f3e64d3b7f7c93e60885a1c9bc7c3f1a7633d1ac078fc58dee8422fa33d7a23

Contents?: true

Size: 697 Bytes

Versions: 7

Compression:

Stored size: 697 Bytes

Contents

# frozen_string_literal: true

require_relative 'command_handler'

module Ftpd

  class CmdFeat < CommandHandler

    def cmd_feat(argument)
      syntax_error if argument
      reply '211-Extensions supported:'
      extensions.each do |extension|
        reply " #{extension}"
      end
      reply '211 END'
    end

    private

    def extensions
      [
        (TLS_EXTENSIONS if tls_enabled?),
        IPV6_EXTENSIONS,
        RFC_3659_EXTENSIONS,
      ].flatten.compact
    end

    TLS_EXTENSIONS = [
      'AUTH TLS',
      'PBSZ',
      'PROT'
    ]

    IPV6_EXTENSIONS = [
      'EPRT',
      'EPSV',
    ]

    RFC_3659_EXTENSIONS = [
      'MDTM',
      'SIZE',
    ]

  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ftpd-2.1.0 lib/ftpd/cmd_feat.rb
ftpd-2.0.5 lib/ftpd/cmd_feat.rb
ftpd-2.0.4 lib/ftpd/cmd_feat.rb
ftpd-2.0.3 lib/ftpd/cmd_feat.rb
ftpd-2.0.2 lib/ftpd/cmd_feat.rb
ftpd-2.0.1 lib/ftpd/cmd_feat.rb
ftpd-2.0.0 lib/ftpd/cmd_feat.rb