nhn / tui.editor

🍞📝 Markdown WYSIWYG Editor. GFM Standard + Chart & UML Extensible.
http://ui.toast.com/tui-editor
MIT License
17.12k stars 1.74k forks source link

Intervene in image download request to add a request header. #2984

Open cgiamouridisEncode opened 1 year ago

cgiamouridisEncode commented 1 year ago

Summary

When the editor viewer sees a markdown content like the one below, it sends a request to the URL inside the parentheses to download and view it. How can one intervene to that request in order to add an HTTP request header just before it is sent? Thank you.

![example.png](http://somedomain.com/path_to_endpoint_that_downloads_image)

Screenshots

This a request that is made as described above. How can I add a header request, indicated in the circle? image

Version

2.5.2

Additional context

Add any other context about the problem here.

cgiamouridisEncode commented 1 year ago

I now have the suspicion that the component does not explicitly makes a request. It simply creates the respective HTML img element and therefore delegates the responsibility of the downloading to the browser. If this is the case indeed, this question should be closed.

upkey1010 commented 1 year ago

I believe this is the default behavior of browser. The request also send the cookie. you can handle the cookie to get the image in your BE side