Thursday, 17 April 2025

How do I set up an OPTIONS request in Traffic Parrot?

 "UI is making an OPTIONS request but the mock doesn’t seem to be returning the right headers resulting in CORS error. I tried changing port , URL, nothing helped, only the same Allow, Server response headers were being sent back." - Staff Engineer working for a US university.

By default, trafficparrot.properties has a flag set:
trafficparrot.http.optionsResponse.enabled=true

This tells Traffic Parrot to return a default automatic OPTIONS response with the "allow" header set only, for any defined mapping.


If you set the flag to false:

trafficparrot.http.optionsResponse.enabled=false

It will allow you to define your own custom OPTIONS response instead.

No comments:

Post a Comment