Kieran on Nostr: Added support for L402 in snort, also added support on void.cat for L402. This means ...
Added support for L402 in snort, also added support on void.cat for L402.
This means you will get asked to make a payment directly on Snort to view content.
I'm using a slightly modified version of L402 spec in order to make it work nicer for web, since we can't actually see the response when using the URL directly in a <img> or <video> tag we need to make another request, so void.cat will now only respond with 402 status code WITHOUT the invoice, this is to prevent generating 2 invoices for every request, the second request is the same url but with the "Accept" set to "L402" and the method is "OPTIONS", this will return the WWW-Authenticate header which contains the macaroon and invoice, once paid we send the Authorization header as per L402.
That being said it should be compatible with regular L402 spec, i just didn't test it
Published at
2023-05-30 11:07:41Event JSON
{
"id": "b8ee877f5ec7ffeafa8194782578800ada85e945257121cfcb5b27378dc676af",
"pubkey": "63fe6318dc58583cfe16810f86dd09e18bfd76aabc24a0081ce2856f330504ed",
"created_at": 1685444861,
"kind": 1,
"tags": [],
"content": "Added support for L402 in snort, also added support on void.cat for L402.\n\nThis means you will get asked to make a payment directly on Snort to view content.\n\nI'm using a slightly modified version of L402 spec in order to make it work nicer for web, since we can't actually see the response when using the URL directly in a \u003cimg\u003e or \u003cvideo\u003e tag we need to make another request, so void.cat will now only respond with 402 status code WITHOUT the invoice, this is to prevent generating 2 invoices for every request, the second request is the same url but with the \"Accept\" set to \"L402\" and the method is \"OPTIONS\", this will return the WWW-Authenticate header which contains the macaroon and invoice, once paid we send the Authorization header as per L402. \n\nThat being said it should be compatible with regular L402 spec, i just didn't test it",
"sig": "a333b06a7b0c90b6910e5835fd9c441c5112b807bfe8ddb0fb67e0a88a57e6f5317f4731c4a77365138089933e22ac61ce7942147c0f368dda565891f38adc51"
}