[tech]HTTP GETã¡ã½ããã®URIã®é·ãå¶éã調ã¹ã¦ã¿ã
Webã®éçºè
ããã£ã¦ããã¨è¯ããããã¦ãããã¨ã§ãããHTTP GETã¡ã½ããã使ããªã¨ãã話ãèãã¾ããã»ãã¥ãªãã£ã®ç¹ãããã¾ãããHTTP GETã¡ã½ããã§ãã¹ã¦ã®ãã©ã¡ã¼ã¿ããµã¼ãã«éããªãããã¨ããã®ããã®çç±ã®ããã§ãã
å®éã©ãããã§ã¦ããã®ããç¾å¨ããããªã®ãï¼ã¨ããçåãæããã®ã§ãHTTP GETã®å¶éã調ã¹ã¦ã¿ã¾ããã
RFCã§ã¯ã©ããªã£ã¦ããã®ï¼
ã¾ãHTTP1.1ã®RFC2616ã調ã¹ã¾ããã
ã¨ãããããæ¥æ¬èªè¨³ãããã¾ããã®ã§ãå¼ç¨ãããã¾ããhttp://www.studyinghttp.net/cgi-bin/rfc.cgi?2616ãã
HTTP ãããã³ã«ã§ã¯ãURI ã®é·ãã«ã©ããªå¶éãè¨ãã¦ããªãã ãµã¼ãã¯ãèªèº«ãæã¤ã©ããªãªã½ã¼ã¹ã®URI ãæ±ããªããã°ãªããªããããããã®ãã㪠URI ãçæãã GET ãã¼ã¹ã®ãã©ã¼ã ãç¨æãããªããç¡å¶éã®é·ãã® URI ãæ±ããã¹ãã§ããã ããããã® URI ããµã¼ããå¦çã§ãããã®ãããé·ããã°ããµã¼ã㯠414 (Request-URI Too Long) ã¹ãã¼ã¿ã¹ãè¿ãã¹ãã§ãã (section 10.4.15 åç §)ã
注: ããã¤ãã®å¤ãã¯ã©ã¤ã¢ã³ããããã¯ã·å®è£ 㯠255 ãã¤ããè¶ ããé·ããæ㤠URI ãé©åã«ãµãã¼ããã¦ããªããããããªãã®ã§ããµã¼ãã¯ãã®ãã㪠URI ã«é ¼ãå ´åã¯æ³¨æãæãã¹ãã§ããã
ã¤ã¾ãHTTP GETã¡ã½ããã«ã¯RFCä¸ãURIã«255byteã®å¶éã¯ãªãã®ã§ãããè¯ããããã¦ãããããª255byte以ä¸éä¿¡ã§ããªãã¨ããã®ã¯ãããããæ¥ã¦ãã誤解ã§ããã
ç¾å®åé¡ãå¤ãã¯ã©ã¤ã¢ã³ããããã¯ã·ã®å®è£
ãæ°ã«ããå¿
è¦ããªãã§ãããããã255ãã¤ãã¨ããã®ã¯æ°ã«ããå¿
è¦ããªãã§ãããã
åWebãµã¼ãã¯ã©ããªã£ã¦ããã®ï¼
RFCä¸ã¯ãHTTP GETã®URIã®é·ãã«ä¸éããªããã¨ããããã¾ãããã§ã¯ãWebãµã¼ãã§ã¯ãã©ãã¾ã§æ±ããã®ã§ããããï¼
apache2.2
apache2.2ã§ã¯ããã©ã«ãã¯ã8190ãã¤ããããã©ã«ãã§ããããããLimitRequestLineãè¨å®ãããã¨ã§ãå¤æ´å¯è½ã§ããhttp://httpd.apache.org/docs/2.2/mod/core.html#limitrequestlineããå¼ç¨ããã¨ã
ãã®ãã£ã¬ã¯ãã£ãã¯ãHTTP ãªã¯ã¨ã¹ãè¡å ã§è¨±å®¹ããããã¤ãæ° bytes ãæå®ãã¾ãã
LimitRequestLine ãã£ã¬ã¯ãã£ãã«ããã ã¯ã©ã¤ã¢ã³ãããã® HTTP ãªã¯ã¨ã¹ãè¡ã®è¨±å®¹ãµã¤ãºãå¢æ¸ã§ãã¾ãã ãªã¯ã¨ã¹ãè¡ã¯ãHTTPã¡ã½ãããURIããããã³ã«ãã¼ã¸ã§ã³ããæã£ã¦ãããLimitRequestLine ã¯ãµã¼ãã¸ã®ãªã¯ã¨ã¹ãã«å¯¾ã㦠許容ãããªã¯ã¨ã¹ã URI ã®é·ããå¶éãããã¨ã«ãªãã¾ãã ãµã¼ãã¯ãGET ãªã¯ã¨ã¹ãã®ã¯ã¨ãªé¨åãå«ãã¦ããªã½ã¼ã¹ã®ååãå ¥ãã«è¶³ã大ãããå¿ è¦ã¨ãã¾ãã
ã¨ãããã¨ã§ãURIã®ä¸éãããã«å¤§ãããããã¨ãå¯è½ã§ãã
IIS4.0, 5.0
IISã¯URL Scanãã¤ã³ã¹ãã¼ã«ãã¦ãããã©ããã§è¨å®ãå¤ããã¾ããã¬ã¸ã¹ããªãè¨å®ãããã¨ã§ãURLã®é·ããæå®ãããã¨ãã§ããããã«ãªã£ã¦ãã¾ãã
http://technet.microsoft.com/ja-jp/library/bb878118.aspxã«ããã¨URL Scanãã¤ã³ã¹ãã¼ã«ãã¦ããå ´åã¯ãMaxQueryString 2048æåãMaxUrl260æåãä¸éã§ããURL Scanãã¤ã³ã¹ãã¼ã«ãã¦ããªãå ´åã¯ãMaxClientRequestBufferã«ããIISã¸ã®ãªã¯ã¨ã¹ãã®ç·ãã¤ãæ°ãæå®ã§ã
IIS 4.0 | 2MB |
IIS 5.0 | 128k |
IIS 5.0 Windows 2000 Server SP4 | 16k |
ã¨ãªãã¾ãã
ãã©ã¦ã¶ã¯ã©ããªã£ã¦ããã®ï¼
ããããµã¼ãã§åãä»ããããã¨ãã¦ãããã©ã¦ã¶ãããªã¯ã¨ã¹ããéä¿¡ã§ããªããã°æå³ãããã¾ãããããã§ã¯ãã©ã¦ã¶ã«ã¯å¶éããªãã®ã§ããããï¼
IE
IEã¯MicrosoftãURLã®ä¸éã«é¢ããæ å ±ãå ¬éãã¦ãã¾ããhttp://support.microsoft.com/?id=208427ã«ããã¨ã
Internet Explorer ã§ã¯ãURL (Uniform Resource Locator) ã«ä½¿ç¨ã§ããæ大æåæ°ã¯ 2,083 æåã§ãã
GET ã¡ã½ããã使ç¨ããå ´åãæ大æåæ°ã¯ 2,083 æåã«å¶éããã¾ã (å®éã®ãã¹ãå«ããæåæ°)ã
IE3.0ãIE8.0ã¾ã§ã対象ã¨ãªã£ã¦ãã¾ãã®ã§ãã»ã¼ãã¹ã¦ã®ãã¼ã¸ã§ã³ã§2083æå以ä¸ã®æå®ãã§ããªãã¨èããæ¹ãè¯ãã§ããã
Safari
ä»æ§ãããã¥ã¡ã³ãããããã®ãè¦å½ãããªãã£ãã®ã§ãTextAreaã«ãã¼ã¿ãå
¥ãã¦ãéä¿¡ãã¦åä½ã確èªãã¾ããã
Safari v4.0.3 Mac OSX 10.6.1ã§ãã¹ãããã¦ã¿ã¾ãããã1Mbyteã¾ã§ã¯éä¿¡å¯è½ã§ãããããããå¶éã¯ãªãã¨æããã¾ãã
Firefox
ä»æ§ããããã®ãè¦å½ãããªãã£ãã®ã§ãTextAreaã«ãã¼ã¿ãå
¥ãã¦ãéä¿¡ãã¦åä½ã確èªãã¾ããã
Firefox v3.0.11 Mac OSX 10.6.1ã§ãã¹ãããã¦ã¿ã¾ãããã1Mbyteã¾ã§ã¯éä¿¡å¯è½ã§ãããããããå¶éã¯ãªãã¨æããã¾ãã
Firefox v3.5.3 ã§ããã¹ãããã®ã§ãããTextAreaã«ãã¼ã¿ãè²¼ä»ããæ¹æ³ã§ã¯1Mbyteç¨åº¦ã§ãã©ã¦ã¶ãåºã¾ã£ã¦ãã¾ãã¾ããã
ãã¬ã¼ã ã¯ã¼ã¯
Google App Engine(Python)
ã¿ããªå¤§å¥½ããªGoogle App Engineã§ãããå¶éã¯2047ãã¤ãã§ããdev_appserver.pyã®MAX_URL_LENGTHãåç §ãã¦ã¿ã¦ãã ããã
æªèª¿æ»
ã¾ã¨ã
ã¾ã¨ãã¾ãã
HTTP1.1ã®ä»æ§ä¸ã¯HTTP GETã§è»¢éã§ãããã¼ã¿é(=URIã®é·ã)ã«ã¯ä¸éãããã¾ãããWebãµã¼ãã§ããã©ã«ãã¯å¶éããã¦ãã¾ãããè¨å®ã§å¤æ´ãããã¨ãå¯è½ã§ããããããIEã«ã¯URIé·ã2083æåã¨ããå¶éããããããå®è³ªçãªä¸éã¯2083æåã¨ãªãã¾ãã
å¶éãå°ããããã§ãIEãããã¡ã¯ãã¹ã¿ã³ãã¼ãã«ãªã£ã¦ããã®ã§ãããåå¼·ã«ãªãã¾ããã
ééããªã©ããã¾ããããã³ã¡ã³ãã«ã¦ãé£çµ¡ããé¡ããã¾ãã