express icon indicating copy to clipboard operation
express copied to clipboard

Request.accepts documentation

Open marcosmol204 opened this issue 1 month ago • 4 comments

Description

I want to contribute, I say * To do: update docs.* in Request.accepts. How would you like me to update the docs?

Expectations

Guide on how to implement or just remove the comment :)

marcosmol204 avatar Dec 01 '25 21:12 marcosmol204

The JSDoc snippets are certainly outdated (the TODO was introduced almost 12 years ago in https://github.com/expressjs/express/commit/cec0c06a70c874298761282984573475293c0071). Most recent change to existing lines is https://github.com/expressjs/express/commit/fce3d14b5ce51e75a1636ac4ebc251c4017e038b (#2663) from 10 years ago. In the meantime, the documentation on the website (repo) has received some improvements and fixes - most importantly https://github.com/expressjs/expressjs.com/pull/1147 and https://github.com/expressjs/expressjs.com/pull/504, but also https://github.com/expressjs/expressjs.com/pull/324 which reworded the description.

I'd suggest porting the changes made to the API docs on expressjs.com - especially the return types. I wouldn't be surprised if there is more outdated JSDoc documentation, but I don't have time to check that.

krzysdz avatar Dec 02 '25 00:12 krzysdz

@krzysdz So sounds like a good opportunity for a first PR. Taking this :)

marcosmol204 avatar Dec 02 '25 08:12 marcosmol204

https://github.com/expressjs/express/pull/6936

marcosmol204 avatar Dec 02 '25 12:12 marcosmol204

Hi maintainers, This PR updates the JSDoc for req.accepts() so it matches the actual behavior of the underlying accepts module (returning false instead of undefined, and not splitting comma-separated strings).

It addresses issue #6935. Kindly requesting a review when you get time. Thank you!

som14062005 avatar Dec 12 '25 15:12 som14062005