thorium-reader icon indicating copy to clipboard operation
thorium-reader copied to clipboard

LCP: handle the html renewal mode

Open llemeurfr opened this issue 5 years ago • 3 comments

If the server serves an html page as renew link in the status document, the app fails, displaying:

Capture d'écran 2019-12-18 14 28 26

The app should handle this case, display the html page full screen in the app (this is where the loan extension request is processed), propose a close button, return to the initial state (the info panel or the library view depending the chosen UX).

llemeurfr avatar Dec 18 '19 13:12 llemeurfr

HTML renew (i.e. instead of the LSD HTTP POST request) is currently handled by opening an external web browser. We simply test for the text/html or application/xml+xhtml link type (which maps to HTTP content-type header). The screenshot above shows HTTP status code 405 ( https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405 ) which suggests that an incorrect POST / GET / PUT request was issued to the LSD server. @llemeurfr could you please share the publication that exposes such HTML renew link? Thank you!

danielweck avatar Dec 19 '19 10:12 danielweck

Note to devs (LSD link type check): https://github.com/readium/readium-desktop/blob/aacfe6bbd33db5623a01cfb2939713b6015c8790/src/main/services/lcp.ts#L323-L325

danielweck avatar Dec 19 '19 10:12 danielweck

@llemeurfr Laurent, it would be great if the refactored / latest evolution of the LCP server (Go implementation) could include HTML renew links, for testing?

danielweck avatar Aug 26 '22 17:08 danielweck

The LCP Server can easily be configured so that Status documents contain a specific renew URL. The corresponding config parameter is license_status/renew_page_url.

I tested the solution with a simple URL. A new tab is open, great.

llemeurfr avatar Nov 10 '22 14:11 llemeurfr