Skip to content

httpd: accept OPTIONS http method#11316

Open
lpil wants to merge 2 commits into
erlang:masterfrom
lpil:httpd-options
Open

httpd: accept OPTIONS http method#11316
lpil wants to merge 2 commits into
erlang:masterfrom
lpil:httpd-options

Conversation

@lpil

@lpil lpil commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Hello!

Closes: #11119

Thanks to Torbjörn Törnkvist (https://github.com/etnt) for the original investigation and patch.

I had a look for somewhere to write a test for this, but I was unable to locate any existing tests for the other methods, so I was not sure what test code I ought to write for this addition.

I also noticed that erts packet_parser.c does not know of all the HTTP methods. Should that be corrected also?

edit: Oops, I intended to target maint with this PR, but selected master by mistake. Can you correct that, or should I remake the PR?

Closes: erlang#11119

Thanks to Torbjörn Törnkvist (https://github.com/etnt) for the original
investigation and patch.
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

CT Test Results

  2 files   23 suites   24m 4s ⏱️
377 tests 371 ✅  6 💤 0 ❌
770 runs  683 ✅ 87 💤 0 ❌

Results for commit da8f7d5.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@Whaileee Whaileee self-assigned this Jul 1, 2026
@Whaileee Whaileee added the team:PS Assigned to OTP team PS label Jul 1, 2026
@Whaileee

Whaileee commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Hi! Thanks for the PR, it can stay like this and I'll make sure it's included in maint

@Whaileee Whaileee added the testing currently being tested, tag is used by OTP internal CI label Jul 1, 2026
@lpil

lpil commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Thank you. Please let me know if there are any problems or anything else required for this patch.

@garazdawi

Copy link
Copy Markdown
Member

Oops, I intended to target maint with this PR, but selected master by mistake. Can you correct that, or should I remake the PR?

If you click the button to edit the title, I believe you should be able to change the target branch there. (Don't do this now as @Whaileee will take care of it anyway, just an FYI).

@lpil

lpil commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

I did not know that, thanks for the tip!

Add OPTIONS to the bodyless method guard in mod_esi:erl/3 alongside
GET, HEAD, and DELETE.

Add httpd_example:options/3 as an ESI callback target for testing.

Extend test coverage:
- http_format_SUITE:validate_request_line covers all 8 methods on
  HTTP/0.9, 1.0, and 1.1, including OPTIONS * (RFC 9110 Section 7.1)
- httpd_SUITE:options verifies OPTIONS passes validation without ESI
- httpd_SUITE:esi_options verifies OPTIONS routes through mod_esi

Remove notes.md entry.
@Whaileee

Whaileee commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

@lpil I've pushed testcases, and some missing details, like the guard clause for mod_esi

@lpil

lpil commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Great! Thank you 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team:PS Assigned to OTP team PS testing currently being tested, tag is used by OTP internal CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No support for the OPTIONS method in the inets http_server.

3 participants