开发者

Read HTTP header ruby

I have a project that uses an Apache server that demands NTLM auth. If i look with packetracer t开发者_JS百科o the http packets i can see the username in clear text.

My question is how do i read the http headers of the current connection. I have tried:

url = URI.parse('http://www.knowbase.be')
req = Net::HTTP::Get.new('http://www.knowbase.be')
@res = Net::HTTP.start(url.host, url.port) {|http|
  http.request(req)
}

But that gives a http request from server side. Can someone help me with this! I need this functionality for implementing this --> Tutorial


You should probably look at the contents of request.headers, see the documentation. Some tweaking in Apache may be necessary to get the correct header forwarded to Rails.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜