mirror of
				https://github.com/sqlmapproject/sqlmap.git
				synced 2025-11-04 09:57:38 +03:00 
			
		
		
		
	Merge pull request #375 from frohoff/fix_non_ascii_header_name
fixed response header logging for header names with special chars
This commit is contained in:
		
						commit
						2f4cf61271
					
				| 
						 | 
					@ -452,7 +452,7 @@ class Connect(object):
 | 
				
			||||||
            responseMsg += "[#%d] (%d %s):\n" % (threadData.lastRequestUID, code, status)
 | 
					            responseMsg += "[#%d] (%d %s):\n" % (threadData.lastRequestUID, code, status)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if responseHeaders:
 | 
					            if responseHeaders:
 | 
				
			||||||
                logHeaders = "\n".join("%s: %s" % (key.capitalize() if isinstance(key, basestring) else key, getUnicode(value)) for (key, value) in responseHeaders.items())
 | 
					                logHeaders = "\n".join("%s: %s" % (getUnicode(key.capitalize() if isinstance(key, basestring) else key), getUnicode(value)) for (key, value) in responseHeaders.items())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            logHTTPTraffic(requestMsg, "%s%s\n\n%s" % (responseMsg, logHeaders, (page or "")[:MAX_CONNECTION_CHUNK_SIZE]))
 | 
					            logHTTPTraffic(requestMsg, "%s%s\n\n%s" % (responseMsg, logHeaders, (page or "")[:MAX_CONNECTION_CHUNK_SIZE]))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -543,7 +543,7 @@ class Connect(object):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        responseMsg += "[#%d] (%d %s):\n" % (threadData.lastRequestUID, code, status)
 | 
					        responseMsg += "[#%d] (%d %s):\n" % (threadData.lastRequestUID, code, status)
 | 
				
			||||||
        if responseHeaders:
 | 
					        if responseHeaders:
 | 
				
			||||||
            logHeaders = "\n".join("%s: %s" % (key.capitalize() if isinstance(key, basestring) else key, getUnicode(value)) for (key, value) in responseHeaders.items())
 | 
					            logHeaders = "\n".join("%s: %s" % (getUnicode(key.capitalize() if isinstance(key, basestring) else key), getUnicode(value)) for (key, value) in responseHeaders.items())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if not skipLogTraffic:
 | 
					        if not skipLogTraffic:
 | 
				
			||||||
            logHTTPTraffic(requestMsg, "%s%s\n\n%s" % (responseMsg, logHeaders, (page or "")[:MAX_CONNECTION_CHUNK_SIZE]))
 | 
					            logHTTPTraffic(requestMsg, "%s%s\n\n%s" % (responseMsg, logHeaders, (page or "")[:MAX_CONNECTION_CHUNK_SIZE]))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user