sandstorm-io / sandstorm-app-market

Sandstorm app market
Apache License 2.0
136 stars 30 forks source link

Download spk button doesn't actually set filename #142

Open ocdtrekkie opened 3 years ago

ocdtrekkie commented 3 years ago

So I noticed, the download spk feature is written to rename the spk to something reasonable, via the download attribute on the a tag: https://github.com/sandstorm-io/sandstorm-app-market/commit/ea4399471198f48ae2f09b397a9103477f6b9bf4

However, interestingly... it doesn't. I am assuming the issue is that we have a link, and then inside it, is a div button thing, and we're hitting the div button, not the original link?

ocdtrekkie commented 3 years ago

It has nothing to do with the div, if you remove it the behavior is the same... I think the root of it is here: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a where it says "download only works for same-origin URLs, or the blob: and data: schemes."

app-index.sandstorm.io and apps.sandstorm.io are different origins, which is why that attribute doesn't work.