Browse Source

fix get the name servers for a zone not validate zone_id

now the api of get /v2/zones/{zone_id}/nameservers not validate zone_id,
if set zone_id contain spaces, will trigger DBError and return 500.

Change-Id: Ia3e07c42dc548207aa7ff9efcc35a215c9660e54
(cherry picked from commit 0ba52bfb62)
changes/19/687819/1
zhouhenglc ZhouHeng 6 months ago
parent
commit
357a41c428
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      designate/api/v2/controllers/zones/nameservers.py

+ 2
- 0
designate/api/v2/controllers/zones/nameservers.py View File

@@ -16,6 +16,7 @@
import pecan
from oslo_log import log as logging

from designate import utils
from designate.api.v2.controllers import rest
from designate.objects.adapters import DesignateAdapter

@@ -25,6 +26,7 @@ LOG = logging.getLogger(__name__)
class NameServersController(rest.RestController):

@pecan.expose(template='json:', content_type='application/json')
@utils.validate_uuid("zone_id")
def get_all(self, zone_id):
"""List NameServers for Zone"""
request = pecan.request


Loading…
Cancel
Save