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

admin: Stop writing 500 status on invalid requests #4569

Merged
merged 1 commit into from
Feb 11, 2022

Conversation

mintbomb27
Copy link
Contributor

Fixes #4561

@CLAassistant
Copy link

CLAassistant commented Feb 11, 2022

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Did you test that this works as intended? (I would be surprised if it doesn't.)

@mintbomb27
Copy link
Contributor Author

@mholt

Yup! I've tested it! I've also made the status Bad Request for missing object ID and malformed object path.

Screenshot 2022-02-11 at 12 16 56 PM

@francislavoie francislavoie changed the title fix: Caddy API handlConfigId returns 500s admin: Stop writing 500 status on invalid requests Feb 11, 2022
@francislavoie francislavoie added the bug 🐞 Something isn't working label Feb 11, 2022
@francislavoie francislavoie added this to the v2.5.0 milestone Feb 11, 2022
@mholt mholt merged commit 07c7dc6 into caddyserver:master Feb 11, 2022
@mholt
Copy link
Member

mholt commented Feb 11, 2022

Perfect, thank you for checking! Really appreciate the contribution.

mholt pushed a commit that referenced this pull request Mar 8, 2022
* opentelemetry: create a new module

* fix imports

* fix test

* Update modules/caddyhttp/opentelemetry/README.md

Co-authored-by: Dave Henderson <[email protected]>

* Update modules/caddyhttp/opentelemetry/README.md

Co-authored-by: Dave Henderson <[email protected]>

* Update modules/caddyhttp/opentelemetry/README.md

Co-authored-by: Dave Henderson <[email protected]>

* Update modules/caddyhttp/opentelemetry/tracer.go

Co-authored-by: Dave Henderson <[email protected]>

* rename error ErrUnsupportedTracesProtocol

* replace spaces with tabs in the test data

* Update modules/caddyhttp/opentelemetry/README.md

Co-authored-by: Francis Lavoie <[email protected]>

* Update modules/caddyhttp/opentelemetry/README.md

Co-authored-by: Francis Lavoie <[email protected]>

* replace spaces with tabs in the README.md

* use default values for a propagation and exporter protocol

* set http attributes with helper

* simplify code

* Cleanup modules/caddyhttp/opentelemetry/README.md

Co-authored-by: Dave Henderson <[email protected]>

* Update link in README.md

Co-authored-by: Dave Henderson <[email protected]>

* Update documentation in README.md

Co-authored-by: Dave Henderson <[email protected]>

* Update link to naming spec in README.md

Co-authored-by: Dave Henderson <[email protected]>

* Rename module from opentelemetry to tracing

Co-authored-by: Dave Henderson <[email protected]>

* Rename span_name to span

Co-authored-by: Dave Henderson <[email protected]>

* Rename span_name to span

Co-authored-by: Dave Henderson <[email protected]>

* Simplify otel resource creation

Co-authored-by: Dave Henderson <[email protected]>

* handle extra attributes

Co-authored-by: Dave Henderson <[email protected]>

* update go.opentelemetry.io/otel/semconv to 1.7.0

Co-authored-by: Dave Henderson <[email protected]>

* update go.opentelemetry.io/otel version

* remove environment variable handling

* always use tracecontext,baggage as propagators

* extract tracer name into variable

* rename OpenTelemetry to Tracing

* simplify resource creation

* update go.mod

* rename package from opentelemetry to tracing

* cleanup tests

* update Caddyfile example in README.md

* update README.md

* fix test

* fix module name in README.md

* fix module name in README.md

* change names in README.md and tests

* order imports

* remove redundant tests

* Update documentation README.md

Co-authored-by: Dave Henderson <[email protected]>

* Fix grammar

Co-authored-by: Dave Henderson <[email protected]>

* Update comments

Co-authored-by: Dave Henderson <[email protected]>

* Update comments

Co-authored-by: Dave Henderson <[email protected]>

* update go.sum

* update go.sum

* Add otelhttp instrumentation, update OpenTelemetry libraries.

* Use otelhttp instrumentation for instrumenting HTTP requests.

This change uses context.WithValue to inject the next handler into the
request context via a "nextCall" carrier struct, and pass it on to a
standard Go HTTP handler returned by otelhttp.NewHandler. The
underlying handler will extract the next handler from the context,
call it and pass the returned error to the carrier struct.

* use zap.Error() for the error log

* remove README.md

* update dependencies

* clean up the code

* change comment

* move serveHTTP method from separate file

* add syntax to the UnmarshalCaddyfile comment

* go import the file

* admin: Write proper status on invalid requests (#4569) (fix #4561)

* update dependencies

Co-authored-by: Dave Henderson <[email protected]>
Co-authored-by: Francis Lavoie <[email protected]>
Co-authored-by: Vibhav Pant <[email protected]>
Co-authored-by: Alok Naushad <[email protected]>
Co-authored-by: Cedric Ziel <[email protected]>
mholt added a commit that referenced this pull request Jun 2, 2022
* caddytls: Adding ClientCertValidator for custom client cert validations

* caddytls: Cleanups for ClientCertValidator changes

caddytls: Cleanups for ClientCertValidator changes

* Update modules/caddytls/connpolicy.go

Co-authored-by: Francis Lavoie <[email protected]>

* Update modules/caddytls/connpolicy.go

Co-authored-by: Francis Lavoie <[email protected]>

* Update modules/caddytls/connpolicy.go

Co-authored-by: Francis Lavoie <[email protected]>

* Update modules/caddytls/connpolicy.go

Co-authored-by: Francis Lavoie <[email protected]>

* Update modules/caddytls/connpolicy.go

Co-authored-by: Matt Holt <[email protected]>

* Update modules/caddytls/connpolicy.go

Co-authored-by: Matt Holt <[email protected]>

* Unexported field Validators, corrected renaming of LeafVerificationValidator to LeafCertClientAuth

* admin: Write proper status on invalid requests (#4569) (fix #4561)

* Apply suggestions from code review

* Register module; fix compilation

* Add log for deprecation notice

Co-authored-by: Roettges Florian <[email protected]>
Co-authored-by: Francis Lavoie <[email protected]>
Co-authored-by: Matt Holt <[email protected]>
Co-authored-by: Alok Naushad <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Caddy API returns a 500 when trying to POST/GET an id that does not exist
4 participants