Pre-flighted JavaScript requests

PUT request with missing Options API

Summary

JavaScript code can make a cross-origin PUT request. An API must exist to service the pre-flight OPTIONS request, otherwise the browser won’t make the main request.

Instructions

  1. Press F12 to open browser Developer Tools
  2. Open Network tab and filter by path no-options-api
  3. Hit green button below and see that request fails
  4. Verify that pre-flight request received a 404 Not Found response
View source on GitHub | Created by Tom Gregory