rascutã§swfobject.jsã404ã«ãªã
rascutã¯ActionScript絡ã¿ã®ãã¡ã¤ã«ã®å¤æ´ãæ¤åºãã¦, èªåã³ã³ãã¤ã«ããã¡ãããã®. ããã«Cometã§ã³ã³ãã¤ã«å®äºãWebãã©ã¦ã¶ã«éç¥ãã¦, èªåãã¼ãã¾ã§ãã¡ããã«ãããã¤ã§ã. id:secondlifeãã++
ã ãã©ãªããç»é¢ãçã£ç½ã«ãªããã§ããã. Firebugãè¦ãã¨swfobject.jsããªã模æ§. åãçç¶ãåºã¦ãã人ãã£ã±ãã¿ããã ã.
d:id:lifegood:20080928
g:actionscript:id:kusigahama:20080922:1222105950
ã¡ãªã¿ã«ãã¯ã®ç°å¢ã¯ä¸è¨ã®ã¨ãã.
ãã¼ã, rascutã«ãã£ã¦èµ·åãããHTTPãµã¼ãã¼ãããã. ã¨ããã³ãã§httpd.rbã追ã£ã¦ã¿ãã¨, 31è¡ç®ã®:
if F.file?(@path) && F.readable?(@path)
ã§çã«ãªããªã(çã®ã¨ãã«ã¹ãã¼ã¿ã¹ã³ã¼ã200ã¨ãªã). 詳ããè¦ãã¨F.file?(@path)ã®æç¹ã§falseã¨ãªã. ã¦ããã¡ã¤ã«ã§ãããªãã£ã¦!
ãã§åå ã¯ãã®åã®27è¡ç®:
@path = env["PATH_INFO"] == '/' ? @root : F.join(@root, env['PATH_INFO'])
ãã£ã¨è¨ãã¨:
F.join(@root, env['PATH_INFO'])
ã«ãã£ã¦, ~js/swfobject.js/ã¨æå¾ã«ã¹ã©ãã·ã¥ãä»ã. ãã¼, PathInfoã空ã§ãããã¨joinãã¦ããã®ãåé¡ãªã®ããªã?
ã¨ããã³ãã§:
@path = env["PATH_INFO"].empty? || env["PATH_INFO"] == '/' ? @root : F.join(@root, env['PATH_INFO'])
ã¨ãé©å½ã«F.joinãåé¿ãã¦ããã°404ã¨ã¯ãªããªããªãã¾ãã. ãã§ãããã§ãã.