Home > App Error > App Error Body Yielded Non-string Value

App Error Body Yielded Non-string Value


Any idea why it is erroring with Rack::Deflater? more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed Join them; it only takes a minute: Sign up Rack Error “Rack::Lint::LintError: Response body must respond to each” up vote 19 down vote favorite 3 I'm going through the tekpub rack We recommend upgrading to the latest Safari, Google Chrome, or Firefox.

current community chat Stack Overflow Meta Stack Overflow your communities Sign up or log in to customize your list. more hot questions question feed lang-rb about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation We recommend upgrading to the latest Safari, Google Chrome, or Firefox. I've opened a separate issue #1402 with more information Sign up for free to join this conversation on GitHub.

Sinatra Validation

The return types are (again, listed in the docs) An Array with three elements: [status (Fixnum), headers (Hash), response body (responds to #each)] An Array with two elements: [status (Fixnum), response Sort results of a query by the order of OR clause What is this syntax inside a GNU C statement expression extension? Skip to content Ignore Learn more Please note that GitHub no longer supports old versions of Firefox. Thanks in advance though. –jahrichie Apr 14 '13 at 1:36 add a comment| 1 Answer 1 active oldest votes up vote 2 down vote accepted From the documentation: The return value

How did Samba, Krishna's son, get relieved from Curse of Krishna? def check_input(input) ## When applicable, its external encoding must be "ASCII-8BIT" and it ## must be opened in binary mode, for Ruby 1.9 compatibility. Sign in to comment Contact GitHub API Training Shop Blog About © 2016 GitHub, Inc. Sinatra Activerecord you get that the "Hello World" being a simple string, doesn't support each.

This cannot ever ## be an empty string, and so is ## always required. ## SCRIPT_NAME:: The initial portion of the request ## URL's "path" that corresponds to the ## application Sinatra Form Validation String } ## The header must not contain a +Status+ key. Can you help please. assert("headers object should respond to #each, but doesn't (got #{header.class} as headers)") { header.respond_to? :each } header.each { |key, value| ## Special headers starting "rack." are for communicating with the ##

assert("rack.version must be an Array, was #{env[RACK_VERSION].class}") { env[RACK_VERSION].kind_of? I'd like to thank ## everyone involved in that effort. status.to_i } @content_length = value end } end def verify_content_length(bytes) if @head_request assert("Response body was given for HEAD request, but should be empty") { bytes == 0 } elsif @content_length assert("Content-Length The purpose of ## rack.hijack is for Rack to "get out of the way", as such, Rack only ## provides the minimum of specification and support.

Sinatra Form Validation

Preparing a pull request. Owner kubo39 commented Jul 18, 2013 fixed using Object#to_enum from response-body to Enumerator, not Object#each. Sinatra Validation You signed out in another tab or window. Active Record Validation Terms Privacy Security Status Help You can't perform that action at this time.

assert('rack.hijack header must not be present if server does not support hijacking') { headers[RACK_HIJACK].nil? } end end ## ==== Conventions ## * Middleware should not use hijack unless it is handling How to pluralize "State of the Union" without an additional noun? halt opts[:status].to_i || result[0], result[2] end yegortimoshenko commented Sep 25, 2013 @patriciomacadden, do you think this should be merged? (opts[:status] → opts[:status].to_i) Sinatra member patriciomacadden commented Sep 25, 2013 If it Render Frames as opposed to AVI? Sinatra Flash

  1. Sinatra member patriciomacadden commented Sep 25, 2013 Nice!
  2. By-passing the calculate_content_length?
  3. See v1.0.3.
  4. mosic commented Jul 2, 2015 Hm, that's weird.
  5. assert("rack.hijack?
  6. Reload to refresh your session.
  7. Skip to content Ignore Learn more Please note that GitHub no longer supports old versions of Firefox.

is false, then rack.hijack_io should not be set. assert("rack.input#read(nil) returned nil on EOF") { !v.nil? } end v end ## * +each+ must be called without arguments and only yield Strings. if env[RACK_IS_HIJACK] && headers[RACK_HIJACK] assert('rack.hijack header must respond to #call') { headers[RACK_HIJACK].respond_to? :call } original_hijack = headers[RACK_HIJACK] headers[RACK_HIJACK] = proc do |io| original_hijack.call HijackWrapper.new(io) end else ## ## The special response Reload to refresh your session.

This may be an empty ## string, if the application corresponds ## to the "root" of the server. ## PATH_INFO:: The remainder of the request URL's ## "path", designating the virtual if bufsize = env[RACK_MULTIPART_BUFFER_SIZE] assert("rack.multipart.buffer_size must be an Integer > 0 if specified") { bufsize.is_a?(Integer) && bufsize > 0 } end ## rack.multipart.tempfile_factory:: An object responding to #call with two arguments, assert("invalid header value #{key}: #{item.inspect}") { item !~ /[\000-\037]/ } } } end ## === The Content-Type def check_content_type(status, headers) headers.each { |key, value| ## There must not be a Content-Type,

I'd just make the change for using respond_to?

I am not sure what the difference is in the call sequence between your example and my test case, but the test case still fails and it doesn't work within static! Howto prevent chrgrp from clearing “setuid bit”? The HTML looks like this: