HTTP parse error, malformed request - Ruby on Rails

后端 未结 5 1736
长情又很酷
长情又很酷 2021-02-19 02:31

I see the following error in Terminal when attempting to run a Ruby on Rails app.

HTTP parse error, malformed request (): #

        
5条回答
  •  执念已碎
    2021-02-19 02:56

    Here are some possible solutions.

    1. Make sure you are connecting through http://localhost:3000 and not https://localhost:3000.

    2. If the browser redirects to HTTPS and it's Google Chrome, try this solution that addresses an HSTS problem: https://stackoverflow.com/a/28586593

    3. Make sure you do not have the production environment (if that's what you're serving) forcing HTTPS. If that's the problem, comment this out or change true to false:

      config/environments/production.rb

      # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
      config.force_ssl = true
      

提交回复
热议问题