<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>chamotarooo</author_name>
  <author_url>https://blog.hatena.ne.jp/chamotarooo/</author_url>
  <blog_title>chamotaroooのブログ</blog_title>
  <blog_url>https://chamotaro.hatenablog.com/</blog_url>
  <categories>
    <anon>技術</anon>
  </categories>
  <description>この記事で分かること - nc があれば、ブラウザなしで HTTP のやり取りを手で再現できる - Host: の行頭に空白が2つあるだけで、403 が返る。空白を消すと通る - 同じ実験は Python の標準ライブラリだけで再現できる。https は同じ文面を暗号化で包むだけ はじめに 本の実習の通りに nc で HTTP リクエストを手打ちしたら、403 Forbidden が返ってきた。 打ったのは3行だけ。 間違えようがない。 結論から言うと、原因は Host: の前に入っていた空白2つでした。 『Webブラウザエンジニアリング』1の1章に、ブラウザを使わずに Web サーバーへ直接…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fchamotaro.hatenablog.com%2Fentry%2Ftech%2Fhttp-host-header-leading-space&quot; title=&quot;nc で HTTP リクエストを手打ちしたら 403 になった。原因は Host 行の前の空白2つ - chamotaroooのブログ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2026-10-05 23:16:15</published>
  <title>nc で HTTP リクエストを手打ちしたら 403 になった。原因は Host 行の前の空白2つ</title>
  <type>rich</type>
  <url>https://chamotaro.hatenablog.com/entry/tech/http-host-header-leading-space</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
