Skip to content

fix: Adding request-id header in case of empty header value in request#12837

Merged
Baoyuantop merged 6 commits intoapache:masterfrom
shubhammxv:master
Jan 28, 2026
Merged

fix: Adding request-id header in case of empty header value in request#12837
Baoyuantop merged 6 commits intoapache:masterfrom
shubhammxv:master

Conversation

@shubhammxv
Copy link
Copy Markdown
Contributor

@shubhammxv shubhammxv commented Dec 23, 2025

Description

  1. Adding request-id header in case header value comes empty in original request

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@shubhammxv shubhammxv changed the title Adding request-id header in case of empty header value in request fix: Adding request-id header in case of empty header value in request Dec 23, 2025
@shubhammxv shubhammxv marked this pull request as ready for review December 23, 2025 12:15
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Dec 23, 2025
@Baoyuantop
Copy link
Copy Markdown
Contributor

Hi @shubhammxv, could you explain in detail why this modification was necessary? What is your specific scenario?

@Baoyuantop Baoyuantop added the wait for update wait for the author's response in this issue/PR label Dec 24, 2025
@shubhammxv
Copy link
Copy Markdown
Contributor Author

Hi @Baoyuantop

In all the scenarios, we return x-request-id in response headers when include_in_response is true except when it comes as empty.
When it is passed as empty, then no header comes back in response (empty value header gets omitted) and it gives perception as if plugin is not working.

Also, the plugin's main functionality is to track the requests, But empty value will not really help track it further.

@Baoyuantop Baoyuantop added awaiting review and removed wait for update wait for the author's response in this issue/PR user responded labels Jan 6, 2026
Comment thread apisix/plugins/request-id.lua Outdated
@Baoyuantop Baoyuantop added wait for update wait for the author's response in this issue/PR and removed awaiting review labels Jan 26, 2026
Comment thread apisix/plugins/request-id.lua Outdated
Comment thread apisix/plugins/request-id.lua Outdated
nic-6443
nic-6443 previously approved these changes Jan 28, 2026
Comment thread t/plugin/request-id.t
@Baoyuantop Baoyuantop merged commit b2d14df into apache:master Jan 28, 2026
27 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:M This PR changes 30-99 lines, ignoring generated files. wait for update wait for the author's response in this issue/PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants