-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Ruby NetHttpRequest improvements #19294
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
Comments
Those are very good questions. The inconsistency between What are you trying to achieve? Why do you need access to the fields? |
This sounds like a good idea to me 👍. I think at least The
I'm building on these HTTP request classes to analyze the HTTP headers used in these various frameworks. For example, say we have the following code: require 'faraday'
# requestNode
resp1 = Faraday.get('http://example.com', nil, {'somekey' => 'somevalue'})
# connectionNode
conn = Faraday.new(
url: 'http://example.com',
headers: {'somekey' => 'somevalue'}
)
resp2 = conn.get('/') The easiest way to find these request and connection calls is to use something like |
Description of the issue
Hi all,
I'm building on the Ruby language's
Http::Client::Request
class, particularlyNetHttpRequest
. This is going well, exceptNetHttpRequest
appears to be somewhat of an outlier compared to other client requests. There are two things: 1) its class fields areprivate
instead ofpublic
, and 2) it only has arequestNode
field and is lackingconnectionNode
.For example:
codeql/ruby/ql/lib/codeql/ruby/frameworks/http_clients/NetHttp.qll
Lines 21 to 24 in 2dc88d8
codeql/ruby/ql/lib/codeql/ruby/frameworks/http_clients/Faraday.qll
Lines 25 to 28 in 2dc88d8
codeql/ruby/ql/lib/codeql/ruby/frameworks/http_clients/RestClient.qll
Lines 19 to 21 in 2dc88d8
codeql/ruby/ql/lib/codeql/ruby/frameworks/http_clients/Httparty.qll
Lines 26 to 27 in 2dc88d8
codeql/ruby/ql/lib/codeql/ruby/frameworks/http_clients/Excon.qll
Lines 26 to 29 in 2dc88d8
So my question is, are
NetHttpRequest
class fieldsprivate
for a reason, and if not would it be reasonable to make them public? And if so, would it also be reasonable to add aconnectionNode
field similar toFaradayHttpRequest
,RestClientHttpRequest
, andExconHttpRequest
?I'm happy to open a PR with the changes myself - I just wanted to open an issue to track it first and check that there's not a reason for this discrepancy.
The text was updated successfully, but these errors were encountered: