mirror of
				https://github.com/simon987/sist2.git
				synced 2025-10-31 16:06:53 +00:00 
			
		
		
		
	Version bump, fix mime serve for files with no extensions
This commit is contained in:
		
							parent
							
								
									f87de89275
								
							
						
					
					
						commit
						c7b3d11a6d
					
				| @ -49,7 +49,7 @@ | |||||||
| #include <ctype.h> | #include <ctype.h> | ||||||
| #include "git_hash.h" | #include "git_hash.h" | ||||||
| 
 | 
 | ||||||
| #define VERSION "2.12.1" | #define VERSION "2.12.2" | ||||||
| static const char *const Version = VERSION; | static const char *const Version = VERSION; | ||||||
| 
 | 
 | ||||||
| #ifndef SIST_PLATFORM | #ifndef SIST_PLATFORM | ||||||
|  | |||||||
| @ -285,8 +285,12 @@ void serve_file_from_disk(cJSON *json, index_t *idx, struct mg_connection *nc, s | |||||||
|              "Accept-Ranges: bytes\r\nCache-Control: no-store\r\n", |              "Accept-Ranges: bytes\r\nCache-Control: no-store\r\n", | ||||||
|              name, strlen(ext) == 0 ? "" : ".", ext); |              name, strlen(ext) == 0 ? "" : ".", ext); | ||||||
| 
 | 
 | ||||||
|     char mime_mapping[1024]; |     char mime_mapping[8192]; | ||||||
|  |     if (strlen(ext) == 0) { | ||||||
|  |         snprintf(mime_mapping, sizeof(mime_mapping), "%s=%s", full_path, mime); | ||||||
|  |     } else { | ||||||
|         snprintf(mime_mapping, sizeof(mime_mapping), "%s=%s", ext, mime); |         snprintf(mime_mapping, sizeof(mime_mapping), "%s=%s", ext, mime); | ||||||
|  |     } | ||||||
| 
 | 
 | ||||||
|     struct mg_http_serve_opts opts = { |     struct mg_http_serve_opts opts = { | ||||||
|             .extra_headers = disposition, |             .extra_headers = disposition, | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user