images added to the editor or used for pdf become inaccessible after the sessionId present in the query has expired
Currently, the draftjs editor content which is stored in the mongodb contains image link in the form http://linfalcon.esrf.fr:8000/investigations/{investigationId}/events/{eventId}/file ?sessionId=XXXXXXX.
After some time the sessionId expires and consequently the images link becomes inactive because that particular sessionId is not granted anymore to access this resource.
We discussed that:
- upon receiving a GET /events, the server will parse the event content which is in the format 'draftjs' replacing the expired image sessionId with a valid sessionId. The replacement sessionId is the one provided by the client in the GET /events request. The events with the corrected sessionId are sent back to the client.
- upon receiving a GET /pdf, the server will parse the event content which is in the format 'html' replacing the expired image sessionId with a valid sessionId. The sessionId used is the one provided by the client in the GET /events request. The corrected content is then sent to the pdf converter.
- the server address (http://linfalcon.esrf.fr:8000 is not changed.
- the draftjs editor may also contain text hyperlink. these link are untouched.
- the draftjs editor may also contain external images (linked via the URL tab of the image plugin). These link are not modified.
Edited by Maxime Chaillet