Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Added "onTaffyRequestEnd" functionality #279
Added "onTaffyRequestEnd" functionality, has all the same arguments as "onTaffyRequest" and also adds the response, both in the original format and the parsed response in the format the user has requested. Can be used for global logging or other troubleshooting
Suggested Documentation (Feel free to edit as needed)
This method is optional, and allows you to add global functionality to occur after the call is complete. If you implement it, you can do things such as global logging for all calls.
This function should always return TRUE
Ran into a problem with this patch ... somehow it is breaking the CORS config.
If I comment out the block in api.cfc (lines 477-487) where the onTaffyRequestEnd method is being called, everything works fine. I removed my custom implementation of that method in my Application.cfc just to make sure it was not something I had done and the issue persists.
Only after I disable the call to the method all together does the CORS error go away.
I am not an expert in CORS by any means, so I am still digging here, but the errors shown in the console are as follows:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://myserver.dev/index.cfm/session. (Reason: CORS preflight channel did not succeed).
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://myserver.dev/index.cfm/session. (Reason: CORS request failed).
Ok, I finally tracked this down with Dan Skaggs help. The issue is in the last two arguments being passed to the onTaffyRequestEnd method. With an OPTIONS verb, there is no result, so this throws a 500 error which results in the CORS error on the browser side (hiding the actual error).
I have not gone to look for the backwards compatibility matrix for Taffy, but these two arguments need to be checked for existence before being passed in like this ...
With that, I believe everything is good.