The /fmi location is acting as a proxy to a component of FileMaker server which doesn’t know what to do with the OPTIONS method, so we use a simple rewrite rule to return a 200 ‘success’ status code. Essentially what happens when a browser goes to make a CORS request is that it issues an OPTIONS HTTP request, and then inspects the returned headers. The last three lines are necessary for the CORS preflight check. The third header defines the methods which are supported. It then lists the headers which are allowed to be sent. Sudo /Library/FileMaker\ Server/HTTPServer/bin/httpdctl gracefulīy way of explanation – the first three lines are returning headers which tell the browser that it’s allowed to connect if the code is being run from the ‘Allow-Origin’ location. Save the file, and restart FileMaker apache with.Header always set Access-Control-Allow-Methods "PATCH, GET, POST, DELETE, OPTIONS" Header always set Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Access-Control-Allow-Origin, Authorization" Header always set Access-Control-Allow-Origin "*" At the bottom of that declaration (just before ) add the following lines (setting the Allow-Origin header as appropriate for your environment).Locate the entry likely around line 459.Open /Library/FileMaker Server/HTTPServer/conf/nf.2.4 in your favourite text editor.If you really want ‘everyone’ then use *, otherwise limit this to specific domain(s) on which you will serve content. Think carefully about how you configure this, since you may not want to open your FMS to all locations, so consider what you add as the allowed origins. If you want to be able to access the FileMaker Data API directly from JavaScript running in a client browser you’ll need to set additional headers to support CORS (Cross Origin Request Sharing).
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |