how to fix postMessage error in local environment when using stytch-react - postmessage

Error message from console:
Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('') does not match the recipient window's origin ('').
when I insert debugger on postMessage line in stytch.js. It works fine. I think this problem is related to iframe load event.
how to fix this

Related

The API request failed with the following error: 200 - OK

I administer my shared hosting through cPanel.
It is showing "The API request failed with the following error: 200 - OK." in red popup.
Everything is working fine. I can work on everything as usual, but still this pop?
When i login from another browser, the error is not shown.
How to get rid of it and why is this being shown?
How to get rid of this message was my question.
I had installed a chrom plugin that allowed me to use CORS.
After uninstalling this plugin, the error was gone.

How can you include http://foo.local in CORS Access-Control-Allow-Origin?

I'm using *, but apparently that's not enough. I'm trying to upload a file from a client browser. It works when the client's URL is localhost:3000 or foo.com. It's not working when the URL is http://meteor.local. I've tried changing the third line to <AllowedOrigin>http://meteor.local</AllowedOrigin>, but get the same error.
The browser error:
The error text was misleading – error was not due to the header sent by s3. Adding an access rule to Cordova fixed it. (In meteor, add it with App.accessRule('http://meteor.local'); in mobile-config.js.)

Is it possible to redirect error messages to browser window in Resin 4?

In case of compilation error Resin shows a simple page with the only message:
Server Error
The server is temporarily unavailable due to an internal error. Please
notify the system administrator of this problem.
And all significant information I should seek in the log file.
Is it possible to redirect somehow all error diagnostics to the browser window?
Try setting <development-mode-error-page/> tag to true. In later versions of Resin the value is externalized into resin.properties:dev_mode
http://caucho.com/resin-4.0/reference.xtp#developmentmodeerrorpage

Apache custom dynamic error response

I've seen hundreds of pages explaining how to create custom error pages in Apache 2 server. My question is different. I have a web application running in Apache (it is a ISAPI DLL, but it could also be a CGI executable). My application can handle internal server errors and generate a detailed error message (for instance, include a full stack trace), included in the response together with error code 500. AFAIK, Apache just let me use redirection in order to display custom error messages: http://httpd.apache.org/docs/2.2/custom-error.html
HTTP spec (RFC 2616 - section 10), not only allows but also recommend that detailed error message should be included in the BODY section of the response in case of error code > 500.
Link: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5
Seems that Apache won't let my custom error message go to the browser, and always replace it with its own internal error message and I believe that it is not the correct behavior, based on RFC 2616.
So my question is: Is there any setting in Apache server that will let my custom message go to the browser? Or, is there anything that can be done in my application that will instruct Apache to send my custom error message (something like some specific header field in the response)?
More on the subject:
When my ISAPI application returns error code 500, with other error information in the response body, Apache replaces it with its standard "500 Internal Server Error" message/HTML content, and inside Error.log file I can see the "useless" "Premature end of script headers" message. I'm deeply sure that my headers are fine, including the Content-Type field.
If I replace the 500 error code with any other server error code (e.g. 501) it works flawlessly and my response goes to the browser as is. The same header is sent to the Apache server, only the error code is different (501, instead of 500). With this test result in mind, one of these two must be true:
1- Apache requires some specific header field when status code is 500
2- Apache won't let custom error messages with status code 500 go to the browser.
I don't see any other alternative.
I think you're conflating two questions. You can generate a 500 response with a CGI script and include your custom body. Or you can override any 500 with any resource you want.
If you're failing to do the former, it's likely because of some subtle thing in the ISAPI interface between Apache and your module. Desk-checking the code says you should be able either set the pseudo
Status: 500
Header, or basically return any ISAPI error and end up with a 500 and your custom body.
Apache has two notions of a status code -- the one in the status line (r->status) and an error code returned separately from the module that handles the request (return HTTP_INTERNAL_SERVER_ERROR, return r->status).
When the former is used as the latter is when the custom error messages get lost. All of that happens in./modules/arch/win32/mod_isapi.c in Apache. Whatever is going on, it is ISAPI unique.

How to replace Jetty's default error page when the server is muted

I'm trying to handle a use case where my server is muted and a user try to access it.
Today when the server is muted the user get the jetty's default error page for 503 (HTTP ERROR: 503).
I would like to replace this error page with a custom error page.
I do have custom pages on my web.xml, but it is not loaded (since the server is muted).
I tried writing my own error handler that extends ErrorPageErrorHandler, and I registered it on jetty-web.xml
O debug I see that my class is loaded, but it does not activate when the error happens.
I'm muting the server by stopping my DB service. It seems that this causes the ContextLoader to fail. Here is a partial stack trace, any insights would help:
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:192)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:643)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:233)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1213)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:589)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:454)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:224)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:167)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:89)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:89)
at org.eclipse.jetty.server.Server.doStart(Server.java:261)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
at com.hp.qc.JettyRunner.startJetty(JettyRunner.java:73)
at com.hp.qc.JettyRunner.main(JettyRunner.java:31)