Closed alexkiousis closed 6 years ago
The upsert endpoint doesn't check something correctly when using shortname instead of fqdn:
curl -X POST http://localhost:3000/api/domain/example.com/bulk?token=a73a8126f7e88d35089e -H 'Content-Type: application/json' -d '{ "upserts": [ { "name": "dsa", "type": "A", "content": "1.1.1.1" } ] }' {"ok":true,"response":{"operations":{"additions":[{"name":"dsa.example.com","content":"1.1.1.1","type":"A","ttl":null,"prio":null,"disabled":false}]}}} curl -X POST http://localhost:3000/api/domain/example.com/bulk?token=a73a8126f7e88d35089e -H 'Content-Type: application/json' -d '{ "upserts": [ { "name": "dsa", "type": "A", "content": "1.1.1.1" } ] }' {"ok":true,"response":{"operations":{"additions":[{"name":"dsa.example.com","content":"1.1.1.1","type":"A","ttl":null,"prio":null,"disabled":false}]}}} curl -X POST http://localhost:3000/api/domain/example.com/bulk?token=a73a8126f7e88d35089e -H 'Content-Type: application/json' -d '{ "upserts": [ { "name": "dsa", "type": "A", "content": "1.1.1.1" } ] }' {"ok":true,"response":{"operations":{"additions":[{"name":"dsa.example.com","content":"1.1.1.1","type":"A","ttl":null,"prio":null,"disabled":false}]}}}
-- "name": "dsa.example.com", "content": "1.1.1.1", "type": "A", -- "name": "dsa.example.com", "content": "1.1.1.1", "type": "A", -- "name": "dsa.example.com", "content": "1.1.1.1", "type": "A",
When you send a POST with the FQDN content:
curl -X POST http://localhost:3000/api/domain/example.com/bulk?token=a73a8126f7e88d35089e -H 'Content-Type: application/json' -d '{ "upserts": [ { "name": "dsa.example.com", "type": "A", "content": "1.1.1.1" } ] }' {"ok":true,"response":{"operations":{"deletes":[{"name":"dsa.example.com","content":"1.1.1.1","type":"A","ttl":null,"prio":null,"disabled":false},{"name":"dsa.example.com","content":"1.1.1.1","type":"A","ttl":null,"prio":null,"disabled":false},{"name":"dsa.example.com","content":"1.1.1.1","type":"A","ttl":null,"prio":null,"disabled":false}],"additions":[{"name":"dsa.example.com","content":"1.1.1.1","type":"A","ttl":null,"prio":null,"disabled":false}]}}}
-- "name": "dsa.example.com", "content": "1.1.1.1", "type": "A",
it seems to cleanup all wrongly inserted values.
The upsert endpoint doesn't check something correctly when using shortname instead of fqdn:
When you send a POST with the FQDN content:
it seems to cleanup all wrongly inserted values.