yamine 0.14.2 → 0.14.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 56dbba9d974dc247a9f96271e6dd40e0e68b170a6ad20f9e0660aa6fa1d20a28
4
- data.tar.gz: 218da1110324af22c665581eeb26101a29628f1f4e96fed47e492aebd6c18488
3
+ metadata.gz: 8af42a840ce756689e6c37140a3a8cdf402c51aa71b9819b88df624d6a6ffaae
4
+ data.tar.gz: 0a51ab3de0e5605ea8b5152720f76957530722a1b65740dfebc0ab29d14337f9
5
5
  SHA512:
6
- metadata.gz: 9e26fe517122747c2793eb2b441fe83289898796d47c99330d2589413873fa7a12ae1cc2a8b1da69928b39bc6f8ed01aa6e7647f682a872c80886d04d1a862be
7
- data.tar.gz: ce6b77f5a0263594e698cae37ddd3673a8dc6e16a63b946f8bd0f3b939747d80ce86bbc19e100da84a4a7b38aa942de39d86cdc509e348d71d817bc7a6def433
6
+ metadata.gz: e7823296acbadf8e6cc07079ff3f2d3ad56809d2de4973e6ed821124888cd2ee2144e267a754e585454fbc5c808c23fb9984e8da9880de4fda3b2b58bfcfff65
7
+ data.tar.gz: 2642187bbffd601efb5272f557577014704a4415b76c45eefbfa177d3e337b62074d5b60f36525c7a25b174684af7ccc5da31bbd8abaf59a9cdfa9fb864fae96
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.14.3] — 2026-09-15
4
+
5
+ ### Fixed
6
+
7
+ - **WebSocket upgrades carry the same forwarded headers as every other
8
+ request.** Upgrade requests (ActionCable, Turbo Streams over cable)
9
+ were piped to the backend byte-for-byte, so `X-Forwarded-Proto`,
10
+ `X-Forwarded-For`, and `X-Forwarded-Host` never arrived — the one
11
+ request class that skipped `set_forwarded`. An app behind the proxy
12
+ then saw a `wss://` connection as plain `http`, and Rails' ActionCable
13
+ origin check (Origin vs. scheme + Host) compared
14
+ `https://app.localhost` against `http://app.localhost` and refused the
15
+ socket with "Request origin not allowed". Upgrades now run the same
16
+ `set_forwarded` path as every other request before the head is
17
+ forwarded; the bytes after the header block still pipe raw.
18
+
3
19
  ## [0.14.2] — 2026-09-15
4
20
 
5
21
  ### Added
data/lib/yamine/proxy.rb CHANGED
@@ -320,12 +320,18 @@ module Yamine
320
320
 
321
321
  def handle_upgrade(sock, head, buf)
322
322
  routes = cached_routes
323
- _method, _target, headers = parse_head(head)
323
+ method, target, headers = parse_head(head)
324
324
  entry = route(headers["host"].to_s, routes)
325
325
  return unless entry
326
326
 
327
+ # Upgrades carry the same forwarded headers as every other request:
328
+ # an app behind the proxy (ActionCable's origin check) reads the
329
+ # scheme from X-Forwarded-Proto, and a verbatim head would tell a
330
+ # wss:// connection it arrived as http.
331
+ set_forwarded(headers, sock, tls: @tls)
332
+
327
333
  backend = dial(entry)
328
- backend.write(head)
334
+ backend.write(rebuild_head(method, target, headers))
329
335
  backend.write(buf) unless buf.empty?
330
336
  pipe_both(sock, backend)
331
337
  rescue SystemCallError, OpenSSL::SSL::SSLError, IOError => e
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Yamine
4
- VERSION = "0.14.2"
4
+ VERSION = "0.14.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yamine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.2
4
+ version: 0.14.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaka Ruto