mirror of
https://github.com/pyMC-dev/pyMC_Repeater.git
synced 2026-07-13 21:31:31 +02:00
feat: Add CORS support for OPTIONS requests in filtered_packets endpoint
This commit is contained in:
@@ -736,6 +736,11 @@ class APIEndpoints:
|
|||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@cherrypy.tools.json_out()
|
@cherrypy.tools.json_out()
|
||||||
def filtered_packets(self):
|
def filtered_packets(self):
|
||||||
|
# Handle OPTIONS request for CORS preflight
|
||||||
|
if cherrypy.request.method == "OPTIONS":
|
||||||
|
self._set_cors_headers()
|
||||||
|
return ""
|
||||||
|
|
||||||
try:
|
try:
|
||||||
params = self._get_params({
|
params = self._get_params({
|
||||||
'type': None,
|
'type': None,
|
||||||
|
|||||||
Reference in New Issue
Block a user