Sha256: 3e04d0fe1bac70271d4594b7c0308fb1e1bc9cc9ebc7951f69fb2556b594403c

Contents?: true

Size: 666 Bytes

Versions: 11

Compression:

Stored size: 666 Bytes

Contents

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

11 entries across 11 versions & 2 rubygems

Version Path
ftpd-1.1.1 lib/ftpd/cmd_feat.rb
ftpd-1.1.0 lib/ftpd/cmd_feat.rb
investtools-ftpd-1.0.1 lib/ftpd/cmd_feat.rb
ftpd-1.0.1 lib/ftpd/cmd_feat.rb
ftpd-1.0.0 lib/ftpd/cmd_feat.rb
ftpd-0.17.0 lib/ftpd/cmd_feat.rb
ftpd-0.16.0 lib/ftpd/cmd_feat.rb
ftpd-0.15.0 lib/ftpd/cmd_feat.rb
ftpd-0.14.0 lib/ftpd/cmd_feat.rb
ftpd-0.13.0 lib/ftpd/cmd_feat.rb
ftpd-0.12.0 lib/ftpd/cmd_feat.rb