|
| 1 | +Feature: HTTP response types |
| 2 | + Scenario Outline: GET path returns expected response Content-Type |
| 3 | + When a client requests path "<path>" with Accept header "<acceptHeader>" |
| 4 | + Then the response status is <statusCode> |
| 5 | + And the response Content-Type includes "<contentType>" |
| 6 | + |
| 7 | + Examples: |
| 8 | + | path | acceptHeader | statusCode | contentType | |
| 9 | + | / | application/nostr+json | 200 | application/nostr+json | |
| 10 | + | / | text/html | 200 | text/html | |
| 11 | + | /healthz | */* | 200 | text/plain | |
| 12 | + | /terms | */* | 200 | text/html | |
| 13 | + | /privacy | */* | 200 | text/html | |
| 14 | + | /.well-known/nodeinfo | */* | 200 | application/json | |
| 15 | + | /nodeinfo/2.1 | */* | 200 | application/json | |
| 16 | + | /nodeinfo/2.0 | */* | 200 | application/json | |
| 17 | + |
| 18 | + Scenario Outline: dynamic GET path returns expected response Content-Type |
| 19 | + When a client requests dynamic path "<path>" |
| 20 | + Then the response status is <statusCode> |
| 21 | + And the response Content-Type includes "<contentType>" |
| 22 | + |
| 23 | + Examples: |
| 24 | + | path | statusCode | contentType | |
| 25 | + | /admissions/check/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef | 200 | application/json | |
| 26 | + | /invoices/non-existent-invoice/status | 404 | application/json | |
| 27 | + |
| 28 | + Scenario Outline: POST path returns expected response Content-Type |
| 29 | + When a client posts "<body>" to path "<path>" with Content-Type "<contentTypeHeader>" |
| 30 | + Then the response status is <statusCode> |
| 31 | + And the response Content-Type includes "<contentType>" |
| 32 | + |
| 33 | + Examples: |
| 34 | + | path | contentTypeHeader | body | statusCode | contentType | |
| 35 | + | /invoices | application/x-www-form-urlencoded | | 400 | text/plain | |
| 36 | + | /callbacks/zebedee | application/json | {} | 403 | text/html | |
| 37 | + | /callbacks/lnbits | application/json | {} | 403 | text/html | |
| 38 | + | /callbacks/opennode | application/x-www-form-urlencoded | id=test&status=paid | 403 | text/html | |
| 39 | + | /callbacks/nodeless | application/json | {"event":"payment_received"} | 403 | text/html | |
0 commit comments