Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow HTTP extension methods #2847

Merged
merged 2 commits into from
Aug 17, 2024
Merged

Allow HTTP extension methods #2847

merged 2 commits into from
Aug 17, 2024

Conversation

lobsterwise
Copy link
Contributor

While you can create routes with HTTP methods such as PROPFIND and REPORT, Rocket will return 400 errors when handling these requests as it errors for any unknown method. This was fixed by just parsing unknown Hyper methods into Rocket methods.

@SergioBenitez
Copy link
Member

Fun! There's actually a test for this, but it doesn't go through the full server. Can you add a testbench test (testbench/src/servers) that dispatches an http request with an extension method and ensures it works?

@lobsterwise
Copy link
Contributor Author

Okay, added a test for that. It also includes a check that verbs outside of extensions still return errors.

@SergioBenitez SergioBenitez force-pushed the master branch 2 times, most recently from 88d5068 to 6f40f1e Compare August 17, 2024 11:23
lobsterwise and others added 2 commits August 17, 2024 04:25
Also implements 'From<Infallible>' for 'ParseMethodError'.
@SergioBenitez SergioBenitez merged commit ef1cfa0 into rwf2:master Aug 17, 2024
16 checks passed
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.

2 participants