summaryrefslogtreecommitdiff
path: root/lib/chef/http
Commit message (Collapse)AuthorAgeFilesLines
* really fix copslcg/really-fix-copsLamont Granquist2016-01-121-14/+14
|
* chefstyle: fix Lint/StringConversionInInterpolationLamont Granquist2016-01-121-1/+1
| | | | useless use of `"#{foo.to_s}"`
* Convert all uses of Chef::REST to Chef::ServerAPItm/no_more_restThom May2016-01-112-0/+61
| | | | | | | In the process, stop auto-expanding JSON in the HTTP client, and let individual classes control that themselves. Fixes #2737, Fixes #3518
* Capitalize sentencesTim Smith2015-10-181-2/+2
|
* Update the URL in user agent string12.5.0.current.0danielsdeleo2015-07-161-1/+1
|
* Use version 1 as the default API version if not specified.tylercloke2015-06-051-1/+1
| | | | Default to API v1 and expect that places that were affected by v0 -> v1 changes have properly implemented fallback.
* Added versioned Chef Object API support code and repaired Chef::User.create.tylercloke2015-06-051-2/+7
| | | | 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.
* Check if proxy env_var is emptyJon Morrow2015-05-061-6/+10
| | | 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.
* Implemented X-Ops-Server-API-Version in Chef requests.tylercloke2015-05-041-0/+3
| | | | | | | | | | 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.
* use validate_utf8=false option to json encoder for nodeLamont Granquist2015-05-041-1/+6
| | | | | | | 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.
* Fixes 2140 - Honor Proxy from EnvJon Morrow2015-04-141-4/+21
| | | | | | | | | 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.
* Test base HTTP client behaviors for chefzero URL casedanielsdeleo2015-04-011-0/+2
|
* Extract socketless client and add specsdanielsdeleo2015-04-011-0/+205
|
* Escape path for globbing.Claire McQuin2014-09-221-1/+2
|
* Print out request and response body on non-2xx responsejk/http-error-logJohn Keiser2014-09-071-0/+14
|
* response.body may be nilLamont Granquist2014-08-221-2/+7
| | | | | | 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.
* remove some uses of from_jsonLamont Granquist2014-08-121-1/+1
| | | | | | 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.
* Allow requests to opt-out from JSON encoding the bodydanielsdeleo2014-07-301-1/+12
| | | | | | | | * 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.
* Add url scheme to proxy, if not present.Claire McQuin2014-07-091-1/+7
|
* Add missing requires to HTTP and HTTP::Simplehttp-simple-requiresdanielsdeleo2014-06-271-1/+2
|
* Only pass on port in Host header when it is different from default portKlaas Jan Wierenga2014-06-071-1/+9
| | | | for URI scheme (80 or 443). Fixes CHEF-5355.
* added open_timeout to http connectionCam Cope2014-06-051-0/+1
|
* CHEF-5198: a better fixLamont Granquist2014-04-092-4/+16
| | | | | | | | - 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
* reorder middleware in chef::http::simpleLamont Granquist2014-04-091-7/+4
| | | | | | 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.
* Additional debug logs per PR comments.sersut2014-03-271-2/+7
|
* CHEF-5100:Lamont Granquist2014-03-273-15/+14
| | | | | | - Enable Content Validation Check for Chef::HTTP::Simple - Tidy up debug logs / comments - More specs.
* CHEF-5100: reset state for streamed downloadsLamont Granquist2014-03-271-0/+1
| | | | | quick fix to "free" our state from one streamed download request so that we don't pollute the state of the next streamed request.
* CHEF-5041: check for transfer-encoding headerLamont Granquist2014-03-272-13/+32
| | | | | | - skip content-length check in the presence of a transfer-encoding header - also adds debugging and some refactoring
* - Adding X-Remote-Request-Id to the set of headers for every request from ↵PrajaktaPurohit2014-02-071-0/+46
| | | | | | | | | | 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
* move text message to exception classLamont Granquist2014-01-271-1/+1
|
* rename ValidateResponse to ValidateContentLengthLamont Granquist2014-01-271-2/+5
|
* add real error for bad download sizeClaire McQuin2014-01-231-1/+1
|
* validate streaming file sizeClaire McQuin2014-01-236-10/+51
|
* add counting content-length for streaming requestsLamont Granquist2014-01-231-2/+14
|
* adding validation of content-length fieldLamont Granquist2014-01-231-0/+57
|
* Always set a correct Host header to avoid net/http bugdanielsdeleo2013-11-261-0/+7
| | | | | | | 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.
* Update HTTP usage for IPv6 Supportdanielsdeleo2013-11-152-2/+2
| | | | | | | | | | | | * 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.
* Debug request headersdanielsdeleo2013-10-281-0/+4
|
* Change content type warning to debugdanielsdeleo2013-10-251-1/+1
| | | | | There are certain legitimate cases where this occurs and nothing is actually wrong, so don't bother users with it.
* Fix error caused by loading duplicate trusted certsdanielsdeleo2013-10-181-1/+9
|
* Add a directory where trusted certs can be storeddanielsdeleo2013-10-172-0/+18
|
* Add API SSL policydanielsdeleo2013-10-161-0/+12
| | | | Adds config option to verify SSL certs for API requests only
* Extract SSL policy to a DI-able classdanielsdeleo2013-10-162-30/+104
|
* Return the response body by default if we've read itdanielsdeleo2013-10-161-0/+1
| | | | | Otherwise clients like HTTP::Simple don't return anything at all from http requests
* Remove :raw_input option to JSONInput, use Chef::HTTP for knife rawJohn Keiser2013-10-091-8/+5
|
* Use new Chef::ServerAPI API class in upload/download/diffJohn Keiser2013-10-093-18/+98
|
* CHEF-4515: upload sometimes inflates JSON. Fix by using true raw version of ↵John Keiser2013-10-091-2/+18
| | | | Chef::REST
* Fix Chef::HTTP dependence on subclass methodsdanielsdeleo2013-10-081-4/+4
|
* Add a simple HTTP client without json/authN supportdanielsdeleo2013-10-081-0/+16
|
* Move streaming requests to generic HTTP classdanielsdeleo2013-10-081-1/+4
|