1
0
Fork 0
mirror of https://github.com/rest-client/rest-client.git synced 2022-11-09 13:49:40 -05:00
Commit graph

9 commits

Author SHA1 Message Date
Andy Brody
055f3c5cbe Add ParamsArray support to has_file? method. 2015-11-26 22:35:11 -05:00
Andy Brody
014e421bfc Merge remote-tracking branch 'pchambino/payload_to_s' into ab-urlparams
Conflicts:
	lib/restclient/payload.rb
2015-11-16 02:42:14 -08:00
Andy Brody
2630cc3d3a Remove some unused vestigial code.
Remove Request#process_payload, which hasn't actually been used in ages.
Also rewrite the tests that called it to actually test code that is in
use, even though they are bad unit tests.

Remove HashMapForTesting, which was never used.
2015-11-16 02:32:09 -08:00
Andy Brody
0d5674d84a Switch to multipart boundary with more entropy.
The previous boundary used a random number up to 1,000,000 as the
boundary. This is extremely low entropy compared to what most major
browsers use (20 bits). Instead, use a convention more like WebKit.

RestClient previously would be completely unable to upload a file
generated like so, containing `--0--` through `--1000000--`:

    File.open('foo.txt', 'w') {|f|
      1_000_000.times {|i| f.write("--#{i}--\n") }}

Instead, the boundary now looks like this, with about 95 bits of entropy:
    `----RubyFormBoundaryFg2MqiXXQlT5RkUF`
2015-11-15 22:15:51 -08:00
Andy Brody
66b05f9cac Rewrite tests to match the new implementation. 2015-11-12 03:34:06 -08:00
Andy Brody
5ce0c6ebde Fix up tests for encoding changes.
Add a `.to_hash => {}` for the Net HTTP response mocks.
2015-03-13 18:00:51 -07:00
Andy Brody
440b8256e5 Appease rubocop for a few rules. 2014-11-28 00:25:53 -05:00
Pedro Chambino
a200e4facf Calling Payload::Base.to_s returns empty on the second call 2014-04-01 19:46:20 +01:00
Larry Gilbert
d7a11503af Reorganize specs
* Put unit and integration specs into separate subdirectories
* Consolidate all requires of 'webmock/rspec' into spec_helper.rb
* Use WebMock.{disable!,enable!} for specs calling live server
2013-08-30 18:45:06 -07:00
Renamed from spec/payload_spec.rb (Browse further)