+
Skip to content

Conversation

randName
Copy link
Contributor

resolves #1166
supersedes #1167

This will allow the original

if (corsRes) return corsRes

check to work, and as a bonus this might resolve some other footguns due to noContent returning a falsy ""

Not sure if this is the best way to create the FastResponse, and also not sure about what to do with the type for the deprecated sendNoContent

@randName randName requested a review from pi0 as a code owner July 31, 2025 13:42
@randName randName changed the title construct Response for noContent fix: construct Response for noContent Jul 31, 2025
Copy link

codecov bot commented Jul 31, 2025

Codecov Report

❌ Patch coverage is 57.14286% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/utils/cors.ts 25.00% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@randName
Copy link
Contributor Author

tests for those will be covered by #1161

@pi0 pi0 changed the title fix: construct Response for noContent fix: return a Response for no-content Aug 27, 2025
@pi0 pi0 merged commit 59319b5 into h3js:main Aug 27, 2025
3 of 4 checks passed
@pi0
Copy link
Member

pi0 commented Aug 27, 2025

Thanks!

@randName randName deleted the nocontent-response branch August 27, 2025 23:58
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.

handleCors() returns falsy sentinel (""), conflicting with example usage.

2 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载