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

Can we add :trace and :track verbs to the DSL? #1723

Open
todd-a-jacobs opened this issue Sep 14, 2021 · 3 comments
Open

Can we add :trace and :track verbs to the DSL? #1723

todd-a-jacobs opened this issue Sep 14, 2021 · 3 comments

Comments

@todd-a-jacobs
Copy link

Currently, the Sinatra DSL doesn't recognize the TRACE or TRACK verbs. Both are useful in debugging, and may have other uses as well, especially in development. Would a PR for adding the verbs and an implementation for them be accepted into Sinatra?

@rubyFeedback
Copy link

This has been a major issue for me using sinatra. Aside from being unable to modify it easily (e. g. set different public directories as-is), debugging it is super-hard. It's such a shame because the underlying idea is great, but I feel as if we are hitting the end of the road with sinatra, without anything replacing it as-is. :(

(Rails is way too bloated and opinionated to act as a replacement. And padrino follows the rails philosophy. I'd love a sinatra 2.0 variant or actually 3.0 now with 2.1.0 already there ....)

Better debug support would be super-important. It's a black box to me ...

@dentarg
Copy link
Member

dentarg commented Jun 13, 2023

Is TRACK the same as TRACE? I only found https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/TRACE

@todd-a-jacobs
Copy link
Author

todd-a-jacobs commented Jun 13, 2023

Is TRACK the same as TRACE? I only found https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/TRACE

@dentarg Looks like :track is just a special IIS implementation of :trace that echoes the whole request back to the sender. So, AFAICT it's the same thing, but we might want to support them at least as synonyms—maybe just check for IIS in the request header and use :track instead of :trace—for those who write Sinatra code for Ruby on Windows systems. Even if we choose to ignore Windows, IMHO there's a ton of debugging benefit in implementing :trace natively, rather than forcing people to roll their own or using debugging proxies.

I'd be glad to help with a patch for :trace if someone wants to write a failing test. I don't know enough about Sinatra internals to offer one without at least that much minimal guidance, but will happily take a stab at it.

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

No branches or pull requests

3 participants