タグ

httpに関するheiwabokeのブックマーク (4)

  • HTTP_RANGEではまる - にっき

    動画などの大きなファイルを送信するときにファイルの一部をリクエストする「206 Partial Content」があるんだけれども、これではまったのでメモ HTTP_RANGEで必ずしも終了値がリクエストヘッダに含まれるわけではない クライアントからのリクエストヘッダでHTTP_RANGEの形式は Range: bytes=0-1000みたいになっているんだけど、これが Range: bytes=0-のように終了値がしていされないリクエストがあった んで、レスポンスヘッダ側では「Contents-Length」にてRangeの範囲のサイズを返さないといけないんだけれども、単純に以下のような計算式でやっていると終了値がない場合に「Contents-Length」の値がマイナスになってしまってまずい <?php list($dummy, $range) = explode('=', $_SER

    HTTP_RANGEではまる - にっき
  • httpstat.us

    This is a super simple service for generating different HTTP codes. It's useful for testing how your own scripts deal with varying responses. Just add the status code you want to the URL, like this: httpstat.us/200 We'll return a response like this: HTTP/1.1 {status code} {status description} Content-Type: text/plain or application/json Content-Length: {something} {any custom response headers} {st

  • X-Pad: avoid browser bug - @kyanny's blog

    特に何かに困ったわけではないけどメモ。 とあるサイトでこんなレスポンスヘッダをみつけた。 HTTP/1.1 200 OK Date: Wed, 21 Oct 2009 02:31:27 GMT Server: Apache/2.2.3 (CentOS) Last-Modified: Wed, 14 Oct 2009 12:11:11 GMT ETag: "119565d-13ae0-475e40ef875c0" Accept-Ranges: bytes Content-Length: 80608 Connection: close Content-Type: text/html X-Pad: avoid browser bugX-Pad ってなんぞや?と疑問に思ったのでぐぐってみたら PHP-users の過去ログに書いてあった。 [PHP-users 19224]X-Pad: avoid

    X-Pad: avoid browser bug - @kyanny's blog
  • サイト移転時の301リダイレクト処理の具体例:phpspot開発日誌

    Steven Hargrove: How to redirect a web page, the smart way サイト移転時の方法として、301リダイレクトにより、新しいサイトへの転送が最適な方法とされていますが、その301リダイレクト処理の各種具体例。 .htaccess で301リダイレクトを行う方法 特定ページのみの場合は次のようにします。 redirect 301 /old/old.html http://www.yahoo.co.jp 上記は、/old/old.html にアクセスした場合、www.yahoo.co.jp に301リダイレクトされます。 サイトのドメイン移転をした場合は次のように記述します。 RewriteEngine On RewriteCond %{http_host} ^www.from-url.com RewriteRule ^(.*) http:/

  • 1