CORS headers for the admin API #103

Closed
opened 2025-12-29 14:22:34 +01:00 by adam · 6 comments
Owner

Originally created by @alastairtree on GitHub (May 17, 2018).

Originally assigned to: @alastairtree on GitHub.

I have a requirement to support CORS requests on the admin API. Either I add these extra headers to all admin API responces, or i add a setting to enable them and allow users to switch them on as they wish. Normally I prefer security by default, and so CORS would be an opt-in feature, however in this case I cannot think of any realistic scenario where you would want to disable CORS support on the admin API. Wiremock is purely a test tool and not designed for production use, and besides it already has admin API security if needed, and CORS defence is to stop dodgy iframing, which does not seem relevant to wiremock. I think productivity weights more to me than security here - any reason not to just allow all CORS requests on the admin API?

Originally created by @alastairtree on GitHub (May 17, 2018). Originally assigned to: @alastairtree on GitHub. I have a requirement to support CORS requests on the admin API. Either I add these extra headers to all admin API responces, or i add a setting to enable them and allow users to switch them on as they wish. Normally I prefer security by default, and so CORS would be an opt-in feature, however in this case I cannot think of any realistic scenario where you would want to disable CORS support on the admin API. Wiremock is purely a test tool and not designed for production use, and besides it already has admin API security if needed, and CORS defence is to stop dodgy iframing, which does not seem relevant to wiremock. I think productivity weights more to me than security here - any reason not to just allow all CORS requests on the admin API?
adam added the question label 2025-12-29 14:22:34 +01:00
adam closed this issue 2025-12-29 14:22:34 +01:00
Author
Owner

@alastairtree commented on GitHub (May 18, 2018):

(Work started over at 06a7122d66)

@alastairtree commented on GitHub (May 18, 2018): (Work started over at https://github.com/alastairtree/WireMock.Net/commit/06a7122d6620155b889232ce9c42ed31de61c722)
Author
Owner

@StefH commented on GitHub (May 19, 2018):

CORS support sounds OK to add, at least when it's configurable.

In your code I see that you are adding the CORS header manually, isn't there an settings in OWIN to configure this?

@StefH commented on GitHub (May 19, 2018): CORS support sounds OK to add, at least when it's configurable. In your code I see that you are adding the CORS header manually, isn't there an settings in OWIN to configure this?
Author
Owner

@StefH commented on GitHub (Mar 9, 2020):

@alastairtree Any status on this one?

@StefH commented on GitHub (Mar 9, 2020): @alastairtree Any status on this one?
Author
Owner

@StefH commented on GitHub (Nov 9, 2020):

@alastairtree Any updates on your work?

@StefH commented on GitHub (Nov 9, 2020): @alastairtree Any updates on your work?
Author
Owner

@alastairtree commented on GitHub (Nov 9, 2020):

No sorry, this stalled and I have not taken it any further. Realisticly I am unlikely to carry this on so maybe we should just close it?

@alastairtree commented on GitHub (Nov 9, 2020): No sorry, this stalled and I have not taken it any further. Realisticly I am unlikely to carry this on so maybe we should just close it?
Author
Owner

@StefH commented on GitHub (Nov 9, 2020):

No problem. I'll just close this issue.

Take care !

@StefH commented on GitHub (Nov 9, 2020): No problem. I'll just close this issue. Take care !
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net-wiremock#103