| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
See chef/chefstyle#11 for analysis and discussion. We select '{}' since
audit of our source code shows that is the most common, and that used to
be the dominant learning paradigm (e.g. in ruby 1.9 pickaxe book.
|
|
|
|
|
|
|
| |
This is an entirely mechanically generated (chefstyle -a) change, to go
along with chef/chefstyle#5 . We should pick something and use it
consistently, and my opinion is that double quotes are the appropriate
thing.
|
| |
|
|
|
|
| |
useless use of `"#{foo.to_s}"`
|
|
|
|
|
|
|
| |
In the process, stop auto-expanding JSON in the HTTP client, and let
individual classes control that themselves.
Fixes #2737, Fixes #3518
|
| |
|
| |
|
|
|
|
| |
Default to API v1 and expect that places that were affected by v0 -> v1 changes have properly implemented fallback.
|
|
|
|
| |
Also added Chef::User.create V1 API support. Chef::User.create will attempt to use V1 of the server API, and if it fails, it will fall back to V0.
|
|
|
| |
We need to check if the env variable is set to empty string. If we don't we can get in an edge case where we blow up trying to call URI.parse.
|
|
|
|
|
|
|
|
|
|
| |
This takes advantage of Chef::HTTP::Authenticator.handle_request. After the authentication_headers have been merged, it adds:
{'X-Ops-Server-API-Version' => Chef::HTTP::Authenticator::SERVER_API_VERSION}
Chef::HTTP::Authenticator::SERVER_API_VERSION should corrospond to the max version of the server the client is compatible with. We are starting at "0".
I also removed outer level lets :base_header and :req_with_body_headers from rest_spec.rb as they were never used anywhere. Another :base_header was defined in a tighter part of the spec and was only used in that scope, and :req_with_body_headers was never used anywhere.
|
|
|
|
|
|
|
| |
with validation off any bad utf8 data will not cause the
ffi-yajl encoder to raise. with ffi-yajl >= 2.2.0 the bad
data will be scrubbed to produce valid JSON to POST/PUT to
the server.
|
|
|
|
|
|
|
|
|
| |
This change adds support to Chef's core http libs to
honor a proxy uri set in the environment not just
chef/knife config. It also adds support for username
and password both in uri and env.
The order of precidence for values is uri, config, env.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
we can get back things like http 204 with no response body and calling
chomp on that throws a bad stack track. this sends nil back with
the response and the caller can determine how to handle the 204.
|
|
|
|
|
|
| |
fix some things that don't need create_additions at all and just
return standard ruby objects without json_class. convert to
JSONCompat#parse which doesn't do any json_class inflation.
|
|
|
|
|
|
|
|
| |
* JSONInput middleware now checks the incoming headers for a
Content-Type; if set to a non-json type, the body is passed through
unchanged. This allows us to use our normal HTTP client objects to
make requests with non-JSON bodies, such as file uploads.
* Add test coverage for the JSONInput middleware.
|
| |
|
| |
|
|
|
|
| |
for URI scheme (80 or 443). Fixes CHEF-5355.
|
| |
|
|
|
|
|
|
|
|
| |
- reverts previous fix to CHEF-5198
- applies stream handler middleware in (proper) reverse order
- adds debugging around middleware application
- moves dumping of response header debugging to before applying
response/streaming middleware
|
|
|
|
|
|
| |
the api here reverses the order of the reversed order in the
responses for some reason. this broke remote_file for most of the
internet.
|
| |
|
|
|
|
|
|
| |
- Enable Content Validation Check for Chef::HTTP::Simple
- Tidy up debug logs / comments
- More specs.
|
|
|
|
|
| |
quick fix to "free" our state from one streamed download request
so that we don't pollute the state of the next streamed request.
|
|
|
|
|
|
| |
- skip content-length check in the presence of a transfer-encoding
header
- also adds debugging and some refactoring
|
|
|
|
|
|
|
|
|
|
| |
CCR and
knife that will be sent to erchef
- Each knife request has a different X-Remote-Request-Id, where as it
remains the same for all requests originating from the same chef-client
run.
- Adding and fixing tests
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
Net::HTTP fails to surround IPv6 addresses in brackets when constructing
a Host header. Net::HTTP respects any user-supplied Host header, so we
ensure that the Host header is correctly formatted by setting it
manually for all requests.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fixes Chef::HTTP related code to use URI::Generic#hostname when
initializing Net::HTTP objects.
* Replace RestClient usage in cookbook uploader with Chef::HTTP::Simple;
RestClient has the same bug as is fixed in the Chef::HTTP code (and is
difficult to fix with a monkey patch). See:
https://github.com/rest-client/rest-client/blob/0919b02cc57447cf42a67e31aad87ab2a6929da3/lib/restclient/request.rb#L150
* Manually verified with chef-zero; chef-zero's test helper code does
not expose the `:host` parameter so it cannot be used to bind the
server to ::1. Integration tests will be added once this is solved.
|
| |
|
|
|
|
|
| |
There are certain legitimate cases where this occurs and nothing is
actually wrong, so don't bother users with it.
|
| |
|
| |
|
|
|
|
| |
Adds config option to verify SSL certs for API requests only
|
| |
|
|
|
|
|
| |
Otherwise clients like HTTP::Simple don't return anything at all from
http requests
|
| |
|
| |
|
|
|
|
| |
Chef::REST
|
| |
|