Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

fix: handle preflight requests #2175

Merged
merged 3 commits into from
Mar 26, 2025
Merged

fix: handle preflight requests #2175

merged 3 commits into from
Mar 26, 2025

Conversation

vansangpfiev
Copy link
Contributor

@vansangpfiev vansangpfiev commented Mar 26, 2025

Describe Your Changes

This pull request includes several changes to the RunServer function in the engine/main.cc file, focusing on improving signal handling, API key validation, and CORS handling.

Signal handling improvements:

  • Removed an extra semicolon in the signal handler for better code clarity.

API key validation and CORS handling:

  • Refactored the API key validation logic to be part of a new pre-routing advice, which now also handles OPTIONS preflight requests for CORS.
  • Consolidated and simplified the CORS handling into a single function handle_cors, which is used in both pre-routing and post-handling advices. [1] [2]

Fixes Issues

Self Checklist

  • Added relevant comments, esp in complex areas
  • Updated docs (for bug fixes / features)
  • Created issues for follow-up changes or refactoring needed

@vansangpfiev vansangpfiev changed the title fix: handle options preflight fix: handle preflight requests Mar 26, 2025
@vansangpfiev vansangpfiev marked this pull request as ready for review March 26, 2025 05:25
@vansangpfiev vansangpfiev merged commit 588aa95 into dev Mar 26, 2025
8 checks passed
@vansangpfiev vansangpfiev deleted the s/fix/options branch March 26, 2025 07:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants