mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	Allow underscores in name validation
This commit is contained in:
		
							parent
							
								
									3f4303a49d
								
							
						
					
					
						commit
						b4084aa705
					
				@ -103,8 +103,8 @@ module.exports.router = function(config) {
 | 
				
			|||||||
    router.post('/validate', (req, res) => {
 | 
					    router.post('/validate', (req, res) => {
 | 
				
			||||||
        req.checkBody('name', 'Name is required').notEmpty();
 | 
					        req.checkBody('name', 'Name is required').notEmpty();
 | 
				
			||||||
        req
 | 
					        req
 | 
				
			||||||
            .checkBody('name', 'Name must match format ^[0-9a-zA-Z\\.\\-]+$')
 | 
					            .checkBody('name', 'Name must match format ^[0-9a-zA-Z\\.\\-\\_]+$')
 | 
				
			||||||
            .matches(/^[0-9a-zA-Z\\.\\-]+$/i);
 | 
					            .matches(/^[0-9a-zA-Z\\.\\-\\_]+$/i);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        validateRequest(req)
 | 
					        validateRequest(req)
 | 
				
			||||||
            .then(validateUniqueName)
 | 
					            .then(validateUniqueName)
 | 
				
			||||||
@ -115,8 +115,8 @@ module.exports.router = function(config) {
 | 
				
			|||||||
    router.post('/', (req, res) => {
 | 
					    router.post('/', (req, res) => {
 | 
				
			||||||
        req.checkBody('name', 'Name is required').notEmpty();
 | 
					        req.checkBody('name', 'Name is required').notEmpty();
 | 
				
			||||||
        req
 | 
					        req
 | 
				
			||||||
            .checkBody('name', 'Name must match format ^[0-9a-zA-Z\\.\\-]+$')
 | 
					            .checkBody('name', 'Name must match format ^[0-9a-zA-Z\\.\\-\\_]+$')
 | 
				
			||||||
            .matches(/^[0-9a-zA-Z\\.\\-]+$/i);
 | 
					            .matches(/^[0-9a-zA-Z\\.\\-\\_]+$/i);
 | 
				
			||||||
        const userName = extractUser(req);
 | 
					        const userName = extractUser(req);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        validateRequest(req)
 | 
					        validateRequest(req)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user