karlheyes / icecast-kh

KH branch of icecast
GNU General Public License v2.0
298 stars 107 forks source link

Timelimit doesn't work when serving file #320

Open praby opened 4 years ago

praby commented 4 years ago

Hello,

I’am using icecast-2.4.0-kh14 and I will try to return only first 30s of an MP3’s file.

I’m using the following configuration:

<fileserve>1</fileserve>
<mount >
    <mount-name>/*.mp3</mount-name>
    <authentication type="url">
        <option name="listener_add" value="https://<url>/listener_action"/>
        <option name="listener_remove" value="https://<url>/listener_action"/>
        <option name="username" value="user"/>
        <option name="password" value="pass"/>
    </authentication>
</mount>

Listener_add script returns the following headers: Server: nginx/1.14.2 Date:Thu, 02 Jul 2020 16:25:44 GMT Content-Type: text/html; charset=utf-8 Content-Length: 0 Connection: keep-alive icecast-auth-user: 1 icecast-auth-timelimit: 30 icecast-auth-message: invalid-credential, please provide user and password Access-Control-Allow-Origin: http://localhost:3000 Set-Cookie: session=eyJfcGVybWFuZW50Ijp0cnVlfQ.Ed-cCA.1uNQVqbZI0bBkR6HBc9Xfpye4M0; Expires=Sun, 20-Sep-2020 16:25:44 GMT; HttpOnly; Path=/

But when I retrieve the file, I get the file completely...

Did I miss something, or is it a bug?

Thank you

karlheyes commented 4 years ago

indeed, the check for that is not in the file serving path. There is the client set up part but not the checking. I can havea look in a bit to see if it is easy to add in.

karl.