Skip to content

Conversation

@penguineer
Copy link
Member

This pull request refactors the Tornado request handlers to consistently support Cross-Origin Resource Sharing (CORS) and improves error handling. The main change is the introduction of a reusable BaseCORSHandler, which sets CORS headers and is now used as the base class for several request handlers.

Fixes #15

CORS support and handler refactoring:

  • Added a new BaseCORSHandler class that sets default CORS headers, handles HTTP OPTIONS requests, and ensures error responses also include CORS headers (src/app.py).
  • Updated SpaceAPIHandler, SpaceStateTextHandler, and PictureHandler to inherit from BaseCORSHandler instead of directly from tornado.web.RequestHandler, ensuring these endpoints consistently support CORS (src/app.py).

@penguineer penguineer self-assigned this Sep 17, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds CORS (Cross-Origin Resource Sharing) support to the Tornado web application by introducing a reusable base handler class and refactoring existing handlers to use it.

  • Introduces BaseCORSHandler class that provides CORS headers, OPTIONS handling, and error response CORS support
  • Updates three API handlers to inherit from the new CORS-enabled base class
  • Adds typing import for better type annotations

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@penguineer penguineer merged commit 5bd0d2c into main Oct 10, 2025
3 checks passed
@penguineer penguineer deleted the 15-send-cors-headers branch October 10, 2025 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Send CORS headers with response

3 participants