protocol-http 0.25.0 → 0.26.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6354e91389524cbc79fb186bb3d5f3a3bc87ff3a904fc1540635ec8bf89db448
4
- data.tar.gz: f83f86976e9dfb6ed8f8adab3f587acf0359377f6254627099ecbc504a3145db
3
+ metadata.gz: 78df5c09889fbba8150a172d085d646850e286ff263d75651240346e918e94b3
4
+ data.tar.gz: ef5914cbb06341c27974ac57ebb9f2799beac0976d84081166d6dbd3c1d32530
5
5
  SHA512:
6
- metadata.gz: 72fdbf93d17bf20fae9591620b0c64a99f02026e677311486a0e7ee94d6b2fdce62063b3bbd31a0e6941ba3f324acc99a0957edba610d659fce1e1e9247ad34e
7
- data.tar.gz: 3280e4a0d39fa6a4ab58ab08c1dfeb2cad6e5ddbddc73906f00552a6c32dab3669e67c86d22f92dafa236745f11d8d75961c398f932cf4790cbe67deeb6807d0
6
+ metadata.gz: 1d84a1f3eb31ca1f44ef6f390bae189d1bea595478a1486bcd04f41ef2c088e2f8d1989ed279056d9a30be688bacbd7c3481cd18484222e88ed93195a81016fd
7
+ data.tar.gz: dcbf2a95b67dd0f2631e5f9339b16c06149e686bf8ff9bc5525bc389cc78692b5a62fcdbc1b830f3f0d7a8ce37472fd3d9ac281ec1c981ce3e558afeb55485d4
checksums.yaml.gz.sig CHANGED
Binary file
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2019-2023, by Samuel Williams.
4
+ # Copyright, 2019-2024, by Samuel Williams.
5
5
  # Copyright, 2023, by Genki Takiuchi.
6
6
 
7
7
  require_relative 'buffered'
@@ -98,6 +98,10 @@ module Protocol
98
98
  return buffer
99
99
  end
100
100
 
101
+ def readpartial(length)
102
+ read_partial(length) or raise EOFError, "End of file reached!"
103
+ end
104
+
101
105
  def read_nonblock(length, buffer = nil)
102
106
  @buffer ||= read_next
103
107
  chunk = nil
@@ -3,8 +3,6 @@
3
3
  # Released under the MIT License.
4
4
  # Copyright, 2019-2023, by Samuel Williams.
5
5
 
6
- require 'base64'
7
-
8
6
  module Protocol
9
7
  module HTTP
10
8
  module Header
@@ -21,10 +19,10 @@ module Protocol
21
19
  end
22
20
 
23
21
  def self.basic(username, password)
24
- encoded = "#{username}:#{password}"
22
+ strict_base64_encoded = ["#{username}:#{password}"].pack('m0')
25
23
 
26
24
  self.new(
27
- "Basic #{Base64.strict_encode64(encoded)}"
25
+ "Basic #{strict_base64_encoded}"
28
26
  )
29
27
  end
30
28
  end
@@ -22,7 +22,7 @@ module Protocol
22
22
  end
23
23
 
24
24
  def keep_alive?
25
- self.include?(KEEP_ALIVE)
25
+ self.include?(KEEP_ALIVE) && !close?
26
26
  end
27
27
 
28
28
  def close?
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2020-2023, by Samuel Williams.
4
+ # Copyright, 2023, by Samuel Williams.
5
5
 
6
6
  require 'time'
7
7
 
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Protocol
7
7
  module HTTP
8
- VERSION = "0.25.0"
8
+ VERSION = "0.26.1"
9
9
  end
10
10
  end
data/license.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # MIT License
2
2
 
3
- Copyright, 2018-2023, by Samuel Williams.
3
+ Copyright, 2018-2024, by Samuel Williams.
4
4
  Copyright, 2019, by Yuta Iwama.
5
5
  Copyright, 2020, by Olle Jonsson.
6
6
  Copyright, 2020, by Bryan Powell.
@@ -9,6 +9,7 @@ Copyright, 2022, by Herrick Fang.
9
9
  Copyright, 2022, by Dan Olson.
10
10
  Copyright, 2023, by Genki Takiuchi.
11
11
  Copyright, 2023, by Thomas Morgan.
12
+ Copyright, 2023, by Marcelo Junior.
12
13
 
13
14
  Permission is hereby granted, free of charge, to any person obtaining a copy
14
15
  of this software and associated documentation files (the "Software"), to deal
data/readme.md CHANGED
@@ -8,18 +8,15 @@ Provides abstractions for working with the HTTP protocol.
8
8
 
9
9
  - General abstractions for HTTP requests and responses.
10
10
  - Symmetrical interfaces for client and server.
11
- - Light-weight middlewar model for building applications.
11
+ - Light-weight middleware model for building applications.
12
12
 
13
13
  ## Usage
14
14
 
15
- Please see the [project documentation](https://github.com/socketry/protocol-http) for more details.
15
+ Please see the [project documentation](https://socketry.github.io/protocol-http/) for more details.
16
16
 
17
- - [Getting Started](https://github.com/socketry/protocol-httpguides/getting-started/index) - This guide explains how
18
- to use `protocol-http` for building abstract HTTP interfaces.
17
+ - [Getting Started](https://socketry.github.io/protocol-http/guides/getting-started/index) - This guide explains how to use `protocol-http` for building abstract HTTP interfaces.
19
18
 
20
- - [Design Overview](https://github.com/socketry/protocol-httpguides/design-overview/index) - The interfaces provided
21
- by <code class="language-ruby">Protocol::HTTP</code> underpin all downstream implementations. Therefore, we provide
22
- some justification for the design choices.
19
+ - [Design Overview](https://socketry.github.io/protocol-http/guides/design-overview/index) - This guide explains the high level design of `protocol-http` in the context of wider design patterns that can be used to implement HTTP clients and servers.
23
20
 
24
21
  ## Contributing
25
22
 
@@ -37,7 +34,7 @@ This project uses the [Developer Certificate of Origin](https://developercertifi
37
34
 
38
35
  ### Contributor Covenant
39
36
 
40
- This project is governed by [Contributor Covenant](https://www.contributor-covenant.org/). All contributors and participants agree to abide by its terms.
37
+ This project is governed by the [Contributor Covenant](https://www.contributor-covenant.org/). All contributors and participants agree to abide by its terms.
41
38
 
42
39
  ## See Also
43
40
 
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,15 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protocol-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.25.0
4
+ version: 0.26.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  - Bruno Sutic
9
9
  - Herrick Fang
10
+ - Thomas Morgan
10
11
  - Bryan Powell
11
12
  - Dan Olson
12
13
  - Genki Takiuchi
14
+ - Marcelo Junior
13
15
  - Olle Jonsson
14
16
  - Yuta Iwama
15
17
  autorequire:
@@ -44,7 +46,7 @@ cert_chain:
44
46
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
45
47
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
46
48
  -----END CERTIFICATE-----
47
- date: 2023-09-12 00:00:00.000000000 Z
49
+ date: 2024-02-07 00:00:00.000000000 Z
48
50
  dependencies: []
49
51
  description:
50
52
  email:
@@ -94,7 +96,8 @@ files:
94
96
  homepage: https://github.com/socketry/protocol-http
95
97
  licenses:
96
98
  - MIT
97
- metadata: {}
99
+ metadata:
100
+ documentation_uri: https://socketry.github.io/protocol-http/
98
101
  post_install_message:
99
102
  rdoc_options: []
100
103
  require_paths:
@@ -103,14 +106,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
103
106
  requirements:
104
107
  - - ">="
105
108
  - !ruby/object:Gem::Version
106
- version: 2.7.6
109
+ version: '3.0'
107
110
  required_rubygems_version: !ruby/object:Gem::Requirement
108
111
  requirements:
109
112
  - - ">="
110
113
  - !ruby/object:Gem::Version
111
114
  version: '0'
112
115
  requirements: []
113
- rubygems_version: 3.4.10
116
+ rubygems_version: 3.5.3
114
117
  signing_key:
115
118
  specification_version: 4
116
119
  summary: Provides abstractions to handle HTTP protocols.
metadata.gz.sig CHANGED
Binary file