Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

コメント投稿時にエラー表示される #1204

Open
cress-cc opened this issue Jan 20, 2025 · 1 comment
Open

コメント投稿時にエラー表示される #1204

cress-cc opened this issue Jan 20, 2025 · 1 comment
Labels

Comments

@cress-cc
Copy link
Contributor

cress-cc commented Jan 20, 2025

Describe the bug / 不具合の説明
コメント投稿時に "NoMethodError at /" という画面が表示される。コメントの投稿は反映されている

To Reproduce / 再現手順
Steps to reproduce the behavior:

  1. コメントを入力して投稿ボタンを押す

Expected behavior / 期待した動作

  • Wait or Click here! が表示される

Screenshots / スクリーンショット
Image

Environment / 動作環境

  • OS: Windows 11
  • Browser: Chrome and Edge
  • tDiary Version: 5.3.0
  • Ruby Version: 3.4.1
  • Rack Version: 3.1.8

Additional context

NoMethodError: undefined method '=~' for an instance of CGI::Cookie (NoMethodError)

        if value =~ /[\000-\037]/
                 ^^
        C:/Users/cress/.local/share/gem/ruby/3.4.0/gems/rack-3.1.8/lib/rack/lint.rb:733:in 'Rack::Lint::Wrapper#check_header_value'
        C:/Users/cress/.local/share/gem/ruby/3.4.0/gems/rack-3.1.8/lib/rack/lint.rb:724:in 'block (2 levels) in Rack::Lint::Wrapper#check_headers'
        C:/Users/cress/.local/share/gem/ruby/3.4.0/gems/rack-3.1.8/lib/rack/lint.rb:724:in 'Array#each'
        C:/Users/cress/.local/share/gem/ruby/3.4.0/gems/rack-3.1.8/lib/rack/lint.rb:724:in 'block in Rack::Lint::Wrapper#check_headers'
        C:/Users/cress/.local/share/gem/ruby/3.4.0/gems/rack-3.1.8/lib/rack/lint.rb:701:in 'Hash#each'
        C:/Users/cress/.local/share/gem/ruby/3.4.0/gems/rack-3.1.8/lib/rack/lint.rb:701:in 'Rack::Lint::Wrapper#check_headers'
        C:/Users/cress/.local/share/gem/ruby/3.4.0/gems/rack-3.1.8/lib/rack/lint.rb:76:in 'Rack::Lint::Wrapper#response'
        C:/Users/cress/.local/share/gem/ruby/3.4.0/gems/rack-3.1.8/lib/rack/lint.rb:41:in 'Rack::Lint#call'
        C:/Users/cress/.local/share/gem/ruby/3.4.0/gems/rack-3.1.8/lib/rack/show_exceptions.rb:31:in 'Rack::ShowExceptions#call'
        C:/Users/cress/.local/share/gem/ruby/3.4.0/gems/rack-3.1.8/lib/rack/common_logger.rb:43:in 'Rack::CommonLogger#call'
        C:/Users/cress/.local/share/gem/ruby/3.4.0/gems/rack-3.1.8/lib/rack/content_length.rb:20:in 'Rack::ContentLength#call'
        C:/Users/cress/.local/share/gem/ruby/3.4.0/gems/rackup-2.2.1/lib/rackup/handler/webrick.rb:111:in 'Rackup::Handler::WEBrick#service'
        C:/Users/cress/.local/share/gem/ruby/3.4.0/gems/webrick-1.9.1/lib/webrick/httpserver.rb:140:in 'WEBrick::HTTPServer#service'
        C:/Users/cress/.local/share/gem/ruby/3.4.0/gems/webrick-1.9.1/lib/webrick/httpserver.rb:96:in 'WEBrick::HTTPServer#run'
        C:/Users/cress/.local/share/gem/ruby/3.4.0/gems/webrick-1.9.1/lib/webrick/server.rb:310:in 'block in WEBrick::GenericServer#start_thread'
127.0.0.1 - - [21/Jan/2025:08:17:15 +0900] "POST / HTTP/1.1" 500 50204 0.1421
@cress-cc cress-cc added the bug label Jan 20, 2025
@cress-cc
Copy link
Contributor Author

どう修正したらよいかわからず。
https://github.com/tdiary/tdiary-core/blob/master/lib/tdiary/view.rb#L208-L213

@cookies << CGI::Cookie::new( {
	'name' => 'tdiary',
	'value' => [@name,@mail],
	'path' => cookie_path,
	'expires' => Time::now.gmtime + 90*24*60*60 # 90days
} )

cress-cc added a commit to cress-cc/tdiary-core that referenced this issue Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant