mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-02 20:06:06 +01:00 
			
		
		
		
	Use fetch helpers instead of fetch (#27026)
WIP because: - [x] Some calls set a `content-type` but send no body, can likely remove the header - [x] Need to check whether `charset=utf-8` has any significance on the webauthn calls, I assume not as it is the default for json content. - [x] Maybe `no-restricted-globals` is better for eslint, but will require a lot of duplication in the yaml or moving eslint config to a `.js` extension. - [x] Maybe export `request` as `fetch`, shadowing the global.
This commit is contained in:
		@@ -1,5 +1,6 @@
 | 
			
		||||
import $ from 'jquery';
 | 
			
		||||
import {hideElem, showElem} from '../utils/dom.js';
 | 
			
		||||
import {GET} from '../modules/fetch.js';
 | 
			
		||||
 | 
			
		||||
export function initInstall() {
 | 
			
		||||
  const $page = $('.page-content.install');
 | 
			
		||||
@@ -111,7 +112,7 @@ function initPostInstall() {
 | 
			
		||||
  const targetUrl = el.getAttribute('href');
 | 
			
		||||
  let tid = setInterval(async () => {
 | 
			
		||||
    try {
 | 
			
		||||
      const resp = await fetch(targetUrl);
 | 
			
		||||
      const resp = await GET(targetUrl);
 | 
			
		||||
      if (tid && resp.status === 200) {
 | 
			
		||||
        clearInterval(tid);
 | 
			
		||||
        tid = null;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user