1
0
mirror of https://github.com/guzzle/guzzle.git synced 2025-02-23 17:44:02 +01:00

29 Commits

Author SHA1 Message Date
Bas Peeters
e26a75f024 Factor http code bounds into exception test 2019-08-13 11:45:29 +02:00
Mponos George
cf86e51dd6 Remove assertEquals in favor of assertSame (#2188) 2018-11-01 22:47:08 +01:00
George Mponos
ffc61ebd8d Fix wrong namespaces 2018-10-31 22:40:38 +02:00
SpacePossum
5c7a5c524e RequestException - check if readable before access (#2081)
* check if readable before access

* Add unit tests for RequestException::getResponseBodySummary

* use real object in test

* update test for older PHP version support

* remove no longer used imports

* Update RequestExceptionTest.php
2018-08-08 06:37:00 +02:00
Gabriel Caruso
38d61ba642 Use PHPUnit\Framework\TestCase instead of PHPUnit_Framework_TestCase 2018-01-23 16:01:32 -02:00
Chris Nanney
7e405efc1a Don't include summary in exception message when body is empty
Exception messages end with ":\n\n" when there is no response body.
2016-10-18 16:32:51 -05:00
Maksim N
113071af3b Obfuscates URI if there is an username and a password present (#1570)
* Obfuscates URI if there is an username and a password present

Lets assume that you include username and password into the URI. Currently, if the exception accrued the error message looks like so:

```
Client error: `POST http://username:secrect@hostname.com/somePath` resulted in a `400 Bad Request` response: ......,  (truncated...)
```

It lead to security issue because password is shown like it is.

This commit will hide the password (replace it with `***`).

* Make `obfuscateUri` private

* Improve tests
2016-09-12 17:07:23 +02:00
Michael Dowling
0a966bbe9c Message tweaks and adding truncation notice 2015-10-26 21:03:44 -07:00
Woody Gilk
5a5893c19f Switch Middleware to use exception factory
The `RequestException::create` factory was not being used anywhere.
Using it inside of `Middleware::httpErrors` simplifies the code and
allows for simpler changes in the future.

Also updates the message formatting of the exception factory to
provide a more complete status, including the body of the response.
2015-10-20 08:43:14 -05:00
Zaghdoudi Amine
a5ee11c332 add http method in message of request Exception 2015-07-02 11:54:49 +02:00
Michael Dowling
a252cb4bcf Updating exceptions 2015-05-26 10:14:51 -07:00
Michael Dowling
251954e092 Adding handler context to request exceptions 2015-04-25 15:03:28 -07:00
Michael Dowling
04a212896f Removing Stream::factory 2015-03-22 17:42:47 -07:00
Michael Dowling
1a9ad6b553 WIP refactor for PSR-7 2015-02-25 14:50:44 -08:00
Michael Dowling
fa8f06609a Merge branch 'ring' into 5-0
Conflicts:
	src/Adapter/Curl/CurlAdapter.php
	src/Adapter/Curl/CurlFactory.php
	src/Adapter/Curl/MultiAdapter.php
	src/Adapter/MockAdapter.php
	src/Adapter/StreamAdapter.php
	src/Event/HeadersEvent.php
	tests/Adapter/Curl/CurlAdapterTest.php
	tests/Adapter/Curl/CurlFactoryTest.php
	tests/Adapter/Curl/MultiAdapterTest.php
	tests/Adapter/Curl/RequestMediatorTest.php
	tests/Adapter/FakeParallelAdapterTest.php
	tests/Adapter/MockAdapterTest.php
	tests/Adapter/StreamAdapterTest.php
	tests/Adapter/StreamingProxyAdapterTest.php
	tests/Adapter/TransactionIteratorTest.php
2014-10-12 19:47:31 -07:00
Michael Dowling
286525b387 Adding a ConnectException 2014-10-10 00:35:58 -07:00
Michael Dowling
c38ff16378 Merge pull request #838 from GrahamCampbell/cs
CS Fixes
2014-10-05 00:16:12 -07:00
Ján Koščo
06e7e28e95 Extend the exception with error information when parsing XML 2014-10-03 14:48:39 +02:00
Graham Campbell
51c641b191 CS fixes 2014-10-01 22:07:32 +01:00
Michael Dowling
8441a7dafe Updating tests 2014-09-21 14:09:04 -07:00
Michael Dowling
2c4fe7a9a8 Fixing RequestException tests 2014-09-20 14:11:40 -07:00
Michael Dowling
cee099a079 Moving batch to Pool. Updating docs. Removing throwImmediately 2014-09-14 12:27:53 -07:00
Michael Dowling
e5f0b6b84d Added the ability to throw exceptions immediately.
Closes #760
2014-08-17 16:21:32 -07:00
Graham Campbell
1080a9a8b3 Removed whitespace in a test 2014-07-26 12:54:40 +01:00
David Thalmann
576832ab7a Fixes #619 : HTTP Status Code is also Exception code 2014-04-02 22:07:12 +02:00
Michael Dowling
1abcf6c2df Adding a check to ensure that an exception cannot have the emitted error setting set to false 2014-03-11 10:43:05 -07:00
Michael Dowling
a933648121 Adding a parse exception test 2014-03-06 10:30:42 -08:00
Michael Dowling
2b2ee1bb95 Hardening the event system for the before and error event so that events are not emitted twice that are encountered during the before event 2014-03-02 12:12:59 -08:00
Michael Dowling
89a8e2ede1 Using PSR-4 and moving namespace from Guzzle to GuzzleHttp
- Moving various namespaces up a level
- Updating docs
- Renaming EventSubscriberInterface to SubscriberInterface
2014-02-16 20:42:45 -08:00