由於問號,我得到一個錯誤。 Someone had the same problem but the answer that was given返回錯誤:如何防止?在Ruby中導致Bad URI錯誤的字符?
uninitialized constant URI::Parser (NameError)
這是我的代碼(在rackup文件):
require 'rubygems'
require 'rack'
require 'time'
require 'set'
require 'uri'
require 'domain_constants'
require "digest/sha1"
URI::DEFAULT_PARSER = URI::Parser.new(:UNRESERVED => URI::REGEXP::PATTERN::UNRESERVED + '?')
請幫我解決這個問題的,我已經花了4小時試圖數字出來這一個。
PS:
我首先得到的錯誤是:
ERROR bad URI `/font/dorianclm-book-webfont.eot?)%20format("eot"),%20url(http://mysite.co:9292/font/dorianclm-book-webfont),%20url(http://mysite.co:9292/font/dorianclm-book-webfont'.
你能告訴你如何得到帶有問號的錯誤嗎?我用管道(|)看過它,但試圖在1.8.7上對舊應用程序的幾個URL進行卷曲,並且我無法重現該錯誤。你使用哪個網絡服務器? – tardate
@tradate我加了錯誤 – Tom
你有沒有對url構造的控制權?它看起來像雙引號引起的問題(「 - > subst與%22)。這適用於我:http:// server/path?)%20format(%22eot%22),%20url(http:// mysite.co:9292/font/dorianclm-book-webfont),%20url(http://mysite.co:9292/font/dorianclm-book-webfont) – tardate