Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 131025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:02:26+00:00 2026-05-11T06:02:26+00:00

In my Rails app I am attempting to create a form that allows users

  • 0

In my Rails app I am attempting to create a form that allows users to create a bookmark.

<% form_tag( contents_path ) do %>   <input name='item_type' value='Bookmark' type='hidden' /></p>   <h3>Create New Bookmark</h3>   <p>Title:<input name='item[title]' type='text' /></p>   <p>URL:<input name='item[url]' type='text' /></p>   <%= submit_tag 'Create' %> <% end %> 

Edit: For clarity, here is the actual html generated by the above template:

<form action='/contents' method='post'><div style='margin:0;padding:0'><input name='authenticity_token' type='hidden' value='cc709c404365f1a5754a7bf0c3fe79ce9ec9f96b' /></div>   <input name='item_type' value='Bookmark' type='hidden' /></p>   <h3>Create New Bookmark</h3>   <p>Title:<input name='item[title]' type='text' /></p>   <p>URL:<input name='item[url]' type='text' /></p>   <input name='commit' type='submit' value='Create' /> </form> 

As you can see it’s a perfectly normal form.


It works great unless an actual URL is entered, in which case the server never responds and I get a message in my mongrel.log file

Error reading HTTP body: #<RuntimeError: Socket read return nil> /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel/http_request.rb:105:in `read_socket' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel/http_request.rb:77:in `read_body' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel/http_request.rb:55:in `initialize' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel.rb:149:in `new' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel.rb:149:in `process_client' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel.rb:285:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel.rb:285:in `initialize' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel.rb:285:in `new' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel.rb:285:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel.rb:268:in `initialize' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel.rb:268:in `new' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel.rb:268:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel/configurator.rb:282:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel/configurator.rb:281:in `each' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel/configurator.rb:281:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/mongrel_rails:128:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel/command.rb:212:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/mongrel_rails:281 /usr/bin/mongrel_rails:16:in `load' /usr/bin/mongrel_rails:16 

As can be seen the request never reaches my controller code.

I have since discovered that submitting any form where a field value starts with the string ‘http:/’ causes the problem. putting any other characters or white-space before it cures the problem. I have also tried this in other Rails apps (on the same server) with the same result.

So it is possible to work around the problem by inserting extra space at the beginning of the string and stripping it on the server.

But I would prefer a server side only fix if one is possible.

I’m hoping that it is just a simple misconfiguration on the server.

I’m running under Rails 2.1.0 on a CPanel based shared hosting arrangement.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T06:02:26+00:00Added an answer on May 11, 2026 at 6:02 am

    The stack trace shows it hasn’t loaded any of the Rails code when it falls over, so it’s probably not a problem with your code or Rails itself. My guess is that your host is using something like mod_security that thinks your request looks suspicious and is mangling the data on you.

    I’ve had no problems with having URLs entered through forms both through Mongrel and Passenger on Apache, though that’s been on a self-managed dedicated server.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My Rails-app has a sign in box with a remember me checkbox. Users who
I have a rails app that I have serving up XML on an infrequent
I have a Rails app that I have successfully tested with Mongrel and Webkit.
I have a Rails app that I need to deploy. Here are the facts:
I have a rails app that has picked up a bit of traction, but
I have a Rails app that sets a cookie and does a redirect to
I have a Rails app that will post some data to another Rails app.
Our rails app is designed as a single code base linking to multiple client
In my rails app I use the validation helpers in my active record objects
On my rails app I have a list of items (like a task list)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.