开发者

In a Rails log file, what does "Processing by ProductsController#index as */*" mean?

开发者 https://www.devze.com 2023-01-17 19:01 出处:网络
In my Rails log file, I see lots of Star开发者_开发问答ted GET \"/\" for 63.148.78.244 at Fri Sep 24 19:03:39 +0000 2010

In my Rails log file, I see lots of

Star开发者_开发问答ted GET "/" for 63.148.78.244 at Fri Sep 24 19:03:39 +0000 2010
  Processing by ProductsController#index as HTML

I understand this means Rails is serving up an HTML page. However, what does this mean?

Started GET "/" for 63.148.78.244 at Fri Sep 24 18:05:51 +0000 2010
  Processing by ProductsController#index as */*
Completed   in 0ms

Why the */*?


It depends on the HTTP_ACCEPT header that is sent by the browser. The common scenario is that the browser sends list of all MIME types that can process and server returns the result in one of them - typically HTML.

But in some cases it's not this way. For example if you use wget without any other parameters.

Try

wget http://yourserver

and you will see in your log file * / * which means that the "browser" accepts anything you will send back (it's quite obvious that wget can accept anything as it is just storing it into the file).

0

精彩评论

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