Apache 302's then 200 to same address

Discussion in 'Apache' started by AirforceMook, Oct 27, 2012.

  1. #1
    I'm running currently running CakePHP on WAMP (Apache 2.2.22).

    For some reason, using the mediaView file-serving function of Cake, Apache is doing something odd. I'm getting a 302 redirect back to the exact same address, which then shows 200 OK. The problem is that this causes the browser/embedded media player to STOP loading the video and thus it displays nothing. (Chrome reports the request as "cancelled")

    I'm getting the following headers:

    [LIST=1]
    [*][COLOR=#000000]GET /videos/stream/59835 HTTP/1.1[/COLOR]
    
    [*][COLOR=#000000]Host: localhost[/COLOR]
    
    [*][COLOR=#000000]Connection: keep-alive[/COLOR]
    
    [*][COLOR=#000000]User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4[/COLOR]
    
    [*][COLOR=#000000]Accept: */*[/COLOR]
    
    [*][COLOR=#000000]Referer: http://localhost/videos/view/59835[/COLOR]
    
    [*][COLOR=#000000]Accept-Encoding: gzip,deflate,sdch[/COLOR]
    
    [*][COLOR=#000000]Accept-Language: en-US,en;q=0.8[/COLOR]
    
    [*][COLOR=#000000]Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3[/COLOR]
    
    [*][COLOR=#000000]Cookie: CAKEPHP=ra51nspr47q5ddcloqinnrhmt1[/COLOR]
    
    [*][COLOR=#000000] [/COLOR]
    
    [*][COLOR=#000000]and then...[/COLOR]
    
    [*][COLOR=#000000] [/COLOR]
    
    [*][COLOR=#000000]HTTP/1.1 200 OK[/COLOR]
    
    [*][COLOR=#000000]Date: Sat, 27 Oct 2012 17:51:18 GMT[/COLOR]
    
    [*][COLOR=#000000]Server: Apache/2.2.22 (Win64) PHP/5.4.3[/COLOR]
    
    [*][COLOR=#000000]X-Powered-By: PHP/5.4.3[/COLOR]
    
    [*][COLOR=#000000]Expires: 0[/COLOR]
    
    [*][COLOR=#000000]Cache-Control: private, must-revalidate, post-check=0, pre-check=0[/COLOR]
    
    [*][COLOR=#000000]Pragma: no-cache[/COLOR]
    
    [*][COLOR=#000000]Content-Length: 388968[/COLOR]
    
    [*][COLOR=#000000]Keep-Alive: timeout=5, max=99[/COLOR]
    
    [*][COLOR=#000000]Connection: Keep-Alive[/COLOR]
    
    [*][COLOR=#000000]Content-Type: video/x-ms-wmv[/COLOR]
    [/LIST]
    Code (markup):
    Apache access log shows:

    
    127.0.0.1 - - [27/Oct/2012:11:53:19 -0600] "GET /videos/stream/59835 HTTP/1.1" 302 -
    127.0.0.1 - - [27/Oct/2012:11:53:19 -0600] "GET /videos/stream/59835 HTTP/1.1" 200 49152
    127.0.0.1 - - [27/Oct/2012:11:53:19 -0600] "GET /users/login HTTP/1.1" 206 4276
    
    Code (markup):
    The only that's confusing me about the access log is that last line. The user is already logged in and thus it shouldn't be requesting or redirecting to that page. Even so, using curl() to grab the video page results in zero data, so I don't think it's spitting out the login page, either.

    Any help is greatly appreciated
     
    AirforceMook, Oct 27, 2012 IP