Negeer HTTP 302
This commit is contained in:
		
							parent
							
								
									0a6dbe5df3
								
							
						
					
					
						commit
						2299b092ad
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -26,7 +26,9 @@ if [ -d ./public ]; then
 | 
			
		|||
    if [ -f ./check-all-links.tmp ]; then
 | 
			
		||||
        for URL in $(cat ./check-all-links.tmp); do
 | 
			
		||||
            HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" "${URL}")
 | 
			
		||||
            if [ ! "${HTTP_CODE}" = "200" ]; then
 | 
			
		||||
            # 200 = OK
 | 
			
		||||
            # 302 = Tijdelijke redirect, bijvoorbeeld als authenticatie nodig is (GitHub)
 | 
			
		||||
            if [ ! "${HTTP_CODE}" = "200" -a ! "${HTTP_CODE}" = "302" ]; then
 | 
			
		||||
                echo "[WARNING] ${URL} (HTTP: ${HTTP_CODE})"
 | 
			
		||||
            fi
 | 
			
		||||
            sleep 2
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue