Open it-ony opened 7 years ago
Is your API being used from an iframe? In that case, the top-level URL must also be HTTPS.
I checked a few of the error entries in raygun. Might be caused by running within an iframe where the top-level context was not served via https.
Why is the secure context within the frame not enough to have access to the request payment api?
See framed documents examples in secure context specification. If the top-level frame is not https, then everything it embeds is considered insecure. I believe the attack vector for non-secure top-level context is to replace what iframes it embeds via a man-in-the-middle attack.
I know that the request payment API requires a secure context. Running it on live, I can see at least 3 different users having the problem with
Failed to construct 'PaymentRequest': Must be in a secure context
, where the raygun report that I have in front of me shows, that they're.The report lists the following details.
URL: https://checkout.spreadshirt.com/#/spreadshirt/2 User-agent: Mozilla/5.0 (Linux; Android 7.0; SM-G950U Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.125 Mobile Safari/537.36 Host: "checkout.spreadshirt.com"
All browsers Chrome 59.0.3071.125 on Android 7.0. And as the URL shows, it's a secure context with a valid certificate.
The stacktrace is
where basically script
p=new PaymentRequest(d,h)
is executed.