I already set UseCorse to false in the config file and set M586 C"*". (or does it not trigger CORS because it's the same host?) I checked the implementation on the Duet side: ĭo you need to store a sessionkey? when does it refresh? do you need to send it in the header?Ĭould that be the reason you are getting a CORS could you please shine some line on the required communication logic for the Duet websocket to reconnect after reset? How is this solved on the DWC? Is there a description somewhere on how the traffic to the websocket must be structured? Whenever I send reset (M112 + M999), the webapp cannot initiate the connection anymore, giving me a network error. I initiate the connection through the websocket and it works. How to connect to the printer again, after a reset or how can we reset the webserver via running into the same error with a custom web-based app to control my printer. This our httpRequest function, using AxiosRequest export async function httpRequest(config: IRequestConfig) `) It seems that no matter what we do on the server side, nothing works only after either, the printer has been turn off and on again, or the webserver has been restarted ( sudo systemctl restart duetwebserver via SSH). However, if reset is hit (on the DWC, M112 code or physically pushing the reset button), I receive the following error when trying to reconnect: Access to XMLHttpRequest at '' from origin ' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Connects, GET, and POST requests can be made. When the printer and software start, it works like a charm. The PC is connected to the printer with Duet 3 6HC with the SBC set as an access point. The web control software is hosted on the internet, and accessed via a PC. If so, this is still an issue that needs to be solved on the backend by configuring your server to reply with the proper headers.I'm working on a web controller for Duet. Manually inspect the failing request and see if the response is missing the header. The easiest way to check is to look at the browser's dev tools and open the network tab. So my feeling is that you did the right thing by configuring your server to append the missing header, but it's possible that something went wrong with this process. The question is whether the server is responding with the correct headers. In terms of the header, setting it in the browser shouldn't make a difference. edit - disregard this, looks like the third argument specifies whether the request should be async or not. In the sample you posted, the status will never be 200. It's been a while since I've manually sent an XMLHttpRequest but I think you need to set the onload property to a function that will be called when the response is received. I would recommend using esri/request for HTTP requests if that's possible. send ( ) //console.log(http.status) if (http. open ( 'HEAD', reportPath, false ) //tRequestHeader('Access-Control-Allow-Headers', '*') Var http = new XMLHttpRequest ( ) var contentResult = "" This checks to see if the report has already been generated, and if so, returns it to the popup. I think the section that's causing all the errors is below. I wrote everything in ArcGIS-JS-API, yes. I tried adding the URL of our webserver and it didn't help.ģ. Yes, they are on the same Windows Server 2012 machine.Ģ. ![]() I'm pulling my hair out trying figure this out.ġ. Origin 'null' is therefore not allowed access." ![]() ![]() I've also tried removing these lines from the webconfig and adding " Access-Control-Allow-Origin, * " under HTTP response headers in our IIS web server manager and I get this error "The 'Access-Control-Allow-Origin' header contains multiple values 'null, *', but only one is allowed. I tried adding this to my JavaScript code and it worked in once instance, but not another.Į.corsEnabledServers.push("") I've tried adding this to our webconfig file, and it doesn't help. ![]() I get the CORS error when the server tries to return the report PDF to the popup in the map window. I have a geoprocessing tool on the ArcGIS server that generates a report from a map click. I've been dealing with this issue for a while.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |