fix cors proxy getting binary data (e.g. png, webp)#4030
fix cors proxy getting binary data (e.g. png, webp)#4030khassel wants to merge 2 commits intoMagicMirrorOrg:developfrom
Conversation
|
Are you sure the try-catch will work? Since the response stream is consumed after const arrayBuffer = await response.arrayBuffer();
res.send(Buffer.from(arrayBuffer));Looking ahead architecturally: We could transition away from the CORS proxy approach mid-term. I'm currently migrating the weather module (which also uses the cors API) to server-side. Once that's done, we could migrate newsfeed's What do you think? |
This comment was marked as spam.
This comment was marked as spam.
|
@KristjanESPERANTO added your suggestion, thanks!
I don't think so because I found a solution using the cors proxy to avoid publishing secrets in browser only modules. Will provide another PR for this, it solves a problem where you have a map url with an access token e.g. in MMM-Flights and hopefully in MMM-RAIN-MAP too ... |
yes, I needed this for the unit tests ... |
Interesting, I hadn't thought about third-party modules. That certainly sounds interesting 👍
Ah, I didn't think about the tests. Would it be possible to update the test mocks from |
I already needed 2 hours to get the tests running so feel free to push such a solution on this branch ... |
|
I know that struggle 🤯 I can't dig deeper into it this tonight. But I'll take a look at it tomorrow. |
fixes #3266