<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/xml.xsl" type="text/xsl"?><feed xmlns="http://www.w3.org/2005/Atom">
  <title>nulog, NULL::something : out of the headphone &gt; 2006 &gt; February &gt; 20 &gt; 解決：はてなからうちのサイトにリクエスト出すと 500</title>
  <link href="http://lowreal.net/logs/2006/02/20/3"/>
  <icon>http://lowreal.net/img/banner.png</icon>
  <link rel="self" type="application/atom+xml" href="http://lowreal.net/logs/2006/02/20/3.atom"/>
  <link rel="alternate" type="application/xhtml+xml" href="http://lowreal.net/logs/2006/02/20/3.xhtml"/>
  <updated>2006-02-20T05:26:58+09:00</updated>
  <author>
    <name>cho45(砂糖)</name>
  </author>
  <id>http://lowreal.net/2006/02/20/3</id>
  <entry>
    <title>解決：はてなからうちのサイトにリクエスト出すと 500</title>
    <link rel="alternate" type="text/html" href="http://lowreal.net/logs/2006/02/20/3.html"/>
    <link rel="alternate" type="application/xml+xhtml" href="http://lowreal.net/logs/2006/02/20/3.xhtml"/>
    <updated>2006-02-20T05:26:58+09:00</updated>
    <published>2006-02-20T05:26:58+09:00</published>
    <id>http://lowreal.net/2006/02/20/3</id>
    <category term="web"/>
    <category term="net"/>
    <content type="xhtml" xml:base="http://lowreal.net/">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>今日たまたまはてな <abbr title="RDF Site Summary | Rich Site Summary | Really Simple Syndication">RSS</abbr> に lowreal.net を突っ込んでみたら 500 Error で登録できないことに気付きました。毎回ちゃんとリクエストしてるのが確認できるので、これ使ってデバッグ。</p>
        <p><abbr title="User Agent">UA</abbr> によって変わることというなら、ヘッダぐらいしかないので、<code>ENV</code> ダンプして再現するかやってみたけど再現せず、、っと思いきや <code class="Ruby">ENV.clear</code> してなかったので、<code>clear</code> してから突っ込んでみたら見事 500 発生。<samp>Accept</samp> が存在すると仮定しているコードがあったので <code class="Ruby">@cgi.accept || "*"</code> に書き換えた。はてなは Accept 送らないみたいだ。</p>
        <p><abbr title="Hyper Text Transfer Protocol">HTTP</abbr> の仕様を見ると <samp>Accept</samp> がない場合は "*" として扱うとあるので、どうせなら <samp>cgi.rb</samp> でここらへんのをやってくれると嬉しいと思った。</p>
        <p>たぶんこれでブクマしたときに要約がちゃんと生成されるはず。ついでに投げ銭 Acceptable に ;)</p>
      </div>
    </content>
  </entry>
</feed>
