Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrii-fediuk committed Jul 10, 2017
1 parent cec265b commit c60c660
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
29 changes: 28 additions & 1 deletion API/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,34 @@ final protected function _construct() {parent::_construct(); $this->addFilterJso
* @used-by \Df\API\Client::p()
* @return array(string => string)
*/
final protected function headers() {return ['Accept' => 'application/json'];}
final protected function headers() {return [
'Accept' => 'application/json'
// 2017-07-10
// Note 1:
// «The REST API allows the use of compression on the request and the response,
// using the standards defined by the HTTP 1.1 specification.
// For better performance, we suggest that clients accept and support compression
// as defined by the HTTP 1.1 specification.
// To use compression, include the HTTP header
// `Accept-Encoding: gzip` or `Accept-Encoding: deflate` in a request.
// The REST API compresses the response if the client properly specifies this header.
// The response includes the header `Content-Encoding: gzip` or `Accept-Encoding: deflate`.»
// https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_rest_compression.htm#topic-title
// Note 2:
// An example of a response's headers:
// Connection: close
// Content-encoding: gzip
// Content-security-policy: referrer origin-when-cross-origin
// Content-type: application/json;charset=UTF-8
// Date: Mon, 10 Jul 2017 03:57:26 GMT
// Expires: Thu, 01 Jan 1970 00:00:00 GMT
// Public-key-pins-report-only: pin-sha256="9n0izTnSRF+W4W4JTq51avTTTTTTQB8duS2bxVLfzXsY="; pin-sha256="6m4uJ26w5zoo/DLDmYTTTTTTWpZ8/GSCPe6SBri8Euw0="; max-age=86400; report-uri="https://calm-dawn-26291.herokuapp.com/hpkp-report/00D0Y000000ZB09";
// Set-cookie: BrowserId=68g3aObUTTTTTTXZwib5Ag;Path=/;Domain=.salesforce.com;Expires=Fri, 08-Sep-2017 03:57:26 GMT
// Strict-transport-security: max-age=31536000; includeSubDomains
// Transfer-encoding: chunked
// Vary: Accept-Encoding
,'Accept-Encoding' => 'gzip'
];}

/**
* 2017-07-09
Expand Down
4 changes: 2 additions & 2 deletions T/Basic.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ final class Basic extends TestCase {
function t00() {}

/**
* 2017-07-08
* @test 2017-07-08
* «Lists summary information about each Salesforce version currently available,
* including the version, label, and a link to each version's root.
* https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_versions.htm
Expand All @@ -22,7 +22,7 @@ function t02_the_latest_version() {echo df_json_prettify(file_get_contents(self:
df_last(df_http_json(self::url('services/data')))['url']
)));}

/** @test 2017-07-09 */
/** 2017-07-09 */
function t03_invalid() {echo df_json_encode(F::s()->invalid());}

/**
Expand Down

0 comments on commit c60c660

Please sign in to comment.