Class Mechanize::HTTP::ContentDispositionParser
In: lib/mechanize/http/content_disposition_parser.rb
Parent: Object

Parser Content-Disposition headers that loosely follows RFC 2183.

Beyond RFC 2183, this parser allows:

  • Missing disposition-type
  • Multiple semicolons
  • Whitespace around semicolons

Methods

Public Class methods

Creates a new parser Content-Disposition headers

Parses the disposition type and params in the content_disposition string. The "Content-Disposition:" must be removed.

Public Instance methods

Parses the content_disposition header. If header is set to true the "Content-Disposition:" portion will be parsed

Extracts disposition-parm and returns a Hash.

  quoted-string = <"> *(qtext/quoted-pair) <">
  qtext         = <any CHAR excepting <">, "\" & CR,
                   and including linear-white-space
  quoted-pair   = "\" CHAR

Parses an RFC 2045 quoted-string

  token := 1*<any (US-ASCII) CHAR except SPACE, CTLs, or tspecials>

Parses an RFC 2045 token

  value := token / quoted-string

Parses an RFC 2045 value

  1*SP

Parses spaces

[Validate]