Wowza Community

Denying cuppertino session with 404 not 403

Hi!

I am writing a plugin to return status: 404 for a non published cuppertino live stream.

public void onHTTPSessionCreate(IHTTPStreamerSession httpSession)
{
    httpSession.setUserHTTPHeader("Status", "404");
    //httpSession.rejectSession();
}

If I use the above setUserHTTPHeader method, it doesn’t override the status. The call gets forwarded down to:

HTTPStreamerAdapterCupertinoStreamer.onPlaylist: Stream not found [live/myStream/playlist.m3u8]: myStream

The response is still Status 200 with a playlist (and then empty chunklist).

If I actually use rejectSession(), I get a Status 403 response (even if i use setuserhttpstatus beforehand). Is there any way to override this to a 404?

I also tried:

httpSession.rejectSession();
httpSession.setUserHTTPHeader("Status", "404");

To no avail, the status returned is still 403.

(I omitted most of the function logic, these are the lines that should change wowza, the rest is just listing publishedStreamNames and matching it to the requested stream name).

Hi,

The only way to do this currently is to do a redirection, but set 404 and an empty Location so

httpSession.redirectSession("",404);

If you do a debug from a client connection you would see

GET /vod/mp4:sample.mp4/playlist.m3u8

HTTP/1.1 404 Not Found

Date: Fri, 13 Jun 2014 11:04:41 GMT

Location:

Accept-Ranges: bytes

Server: FlashCom/3.5.7

Content-Length: 0

It should do what you need.

Andrew.

Hi,

The only way to do this currently is to do a redirection, but set 404 and an empty Location so

httpSession.redirectSession("",404);

If you do a debug from a client connection you would see

GET /vod/mp4:sample.mp4/playlist.m3u8

HTTP/1.1 404 Not Found

Date: Fri, 13 Jun 2014 11:04:41 GMT

Location:

Accept-Ranges: bytes

Server: FlashCom/3.5.7

Content-Length: 0

It should do what you need.

Andrew.

Perfect, works like a charm. Any idea if this behavior will change in the future?