Module: Lotus::Action::Head

Defined in:
lib/lotus/action/head.rb

Overview

Ensures to not send body or headers for HEAD requests and/or for status codes that doesn’t allow them.

See Also:

Since:

  • 0.3.2

Constant Summary collapse

HTTP_STATUSES_WITHOUT_BODY =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Status codes that by RFC must not include a message body

Since:

  • 0.3.2

Set.new((100..199).to_a << 204 << 205 << 304).freeze

Instance Method Summary collapse

Instance Method Details

#finishObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Ensures to not send body or headers for HEAD requests and/or for status codes that doesn’t allow them.

See Also:

  • Lotus::Action#finish

Since:

  • 0.3.2



24
25
26
27
28
29
30
# File 'lib/lotus/action/head.rb', line 24

def finish
  super

  if _requires_no_body?
    @_body = nil
  end
end