How to disable HTTP OPTIONS calls?

Or is it necessary for something?

It seems that I found a topic on the forum - but I can’t do something anymore ((

How are you making your request? Using http.request() or some other method?

Long story short: You can’t. It’s part of how browsers work. Any JS code (defold running in a browser counts) that makes a HTTP request first makes an OPTIONS preflight request to figure out the server’s CORS policy. If it doesn’t pass the CORS check then the browser denies the main request. (Google CORS for more)

If the server is properly configured for CORS (or if the server is on the same domain as the game), then you have nothing to worry about.

3 Likes

yes. i use

		if global_.app_debug_ then
			data = "robots=" .. jsono.encode(robots) .. '&' .. "equipment=" .. jsono.encode(equipment)
		else
			data = crypto.encode("robots=" .. jsono.encode(robots) .. '&' .. "equipment=" .. jsono.encode(equipment))
		end

		http.request(global_.host_name[tostring(global_.host_index)] .. '/?action=' .. global_.workshop_save_url, "POST", save, global_.header, data)
	

Works normal even with aes 128 encryption

but I created another thread about that.

i use xampp on local host