A
A
Alexander Petrov2021-08-04 09:24:34
AJAX
Alexander Petrov, 2021-08-04 09:24:34

XMLHttpRequest request to ip address over http without certificate?

I make a request using XMLHttpRequest.

var formdata = new FormData();
    var file= /*файл из input[type='file']*/

    formdata.append("file", file);
    var ajax = new XMLHttpRequest();
    ajax.upload.addEventListener("progress", progressHandler, false);
    ajax.open("POST", "http://0.0.0.0:8080/upload_video", true); 
    ajax.send(formdata);


At first there was a CORS error, I googled the solution to put a meta tag:
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">


The error disappeared, but this error appeared:
610a324380864957248549.png

For some reason, the request still goes to https, although http is specified in the code. How to fix it?

How to make requests to an ip address via http?

It's just that the project is internal and it makes no sense to hang up on a domain with a certificate and ip addresses can be different for different tasks.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nadim Zakirov, 2021-08-04
@zkrvndm

It is possible if the request is made from the same source, in your case it ishttp://0.0.0.0:8080

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question