IntelOwl icon indicating copy to clipboard operation
IntelOwl copied to clipboard

BUG: Incorrect Header Assignment in Deprecated Endpoint Decorator

Open rootp1 opened this issue 11 months ago • 3 comments

Bug: Wrong date in deprecated endpoint header

Hey maintainers.... I was going through the codebase and noticed a small bug in the deprecated endpoint decorator that could confuse API users.

What's happening:

In api_app/decorators.py around line 36, there's a copy-paste error where the X-End-Of-Life-Date header is getting the wrong value. It's currently set to deprecation_date when it should be set to end_of_life_date.

Here's the problematic line: response.headers["X-End-Of-Life-Date"] = deprecation_date

It should be: response.headers["X-End-Of-Life-Date"] = end_of_life_date

Why this matters:

When you deprecate an endpoint with something like @deprecated_endpoint(deprecation_date="2025-01-01", end_of_life_date="2025-12-31"), API consumers checking the response headers will see January 1st in the X-End-Of-Life-Date field instead of December 31st. This makes it really hard for them to plan their migrations properly.

rootp1 avatar Dec 09 '25 13:12 rootp1

@mlodic @fgibertoni can you please take a look and assign this issue to me

rootp1 avatar Dec 09 '25 13:12 rootp1

@mlodic @fgibertoni i would like to work on this, can you please assign this to me?

IshaanXCoder avatar Dec 10 '25 07:12 IshaanXCoder

@mlodic @fgibertoni I worked on it in #3111.

rootp1 avatar Dec 10 '25 18:12 rootp1