Class: TentD::API::Posts::GetAttachment
- Inherits:
-
Middleware
- Object
- Middleware
- TentD::API::Posts::GetAttachment
- Defined in:
- lib/tentd/api/posts.rb
Instance Method Summary collapse
Methods inherited from Middleware
Methods included from Authorizable
#authorize_env!, #authorize_env?
Constructor Details
This class inherits a constructor from TentD::API::Middleware
Instance Method Details
#action(env) ⇒ Object
280 281 282 283 284 285 286 287 288 289 290 291 |
# File 'lib/tentd/api/posts.rb', line 280 def action(env) return env unless env.response type = env['HTTP_ACCEPT'].split(/;|,/).first if env['HTTP_ACCEPT'] = env.response..first(:type => type, :name => env.params., :fields => [:data]) if env.response = Base64.decode64(.data) env['response.type'] = type else env.response = nil end env end |