mirror of
				https://github.com/go-gitea/gitea
				synced 2025-10-31 03:18:24 +00:00 
			
		
		
		
	Replace ajax with fetch, improve image diff (#27267)
1. Dropzone attachment removal, pretty simple replacement 2. Image diff: The previous code fetched every image twice, once via `img[src]` and once via `$.ajax`. Now it's only fetched once and a second time only when necessary. The image diff code was partially rewritten. --------- Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
		| @@ -11,9 +11,7 @@ const safeMethods = new Set(['GET', 'HEAD', 'OPTIONS', 'TRACE']); | ||||
| export function request(url, {method = 'GET', headers = {}, data, body, ...other} = {}) { | ||||
|   let contentType; | ||||
|   if (!body) { | ||||
|     if (data instanceof FormData) { | ||||
|       body = data; | ||||
|     } else if (data instanceof URLSearchParams) { | ||||
|     if (data instanceof FormData || data instanceof URLSearchParams) { | ||||
|       body = data; | ||||
|     } else if (isObject(data) || Array.isArray(data)) { | ||||
|       contentType = 'application/json'; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user