StreamResource and vaadin application embedded in a webpage

Hi,
I use vaadin application embedded in a webpage according to Vaadin book chapter 11.3.1, e.g.:

<script type="text/javascript">
    var vaadin = {
        vaadinConfigurations: {
            'calc': {
                appUri:'/tk5/Calc',
                pathInfo: '/',
                themeUri: '/tk5/VAADIN/themes/example',
                versionInfo : {
                    vaadinVersion:"5.9.9-INTERNAL-
                         NONVERSIONED-DEBUG-BUILD",
                    applicationVersion:"NONVERSIONED"
                }
            },

StreamResource in a Link does not work in this setup. It generates wrong URL for the resource:

http://localhost:8080/tk5/Calc/APP/1/dynamicPdf.pdf

but the resource is actually here:

http://localhost:8080/tk5/APP/1/dynamicPdf.pdf

So it looks like Link component takes application path (Calc) into account when constructing link url, but whatever is actually serving the dynamic content of StreamResource is not.

Any Idea?
Jan