Skip to content

Clear sensitive headers when redirecting to cross-site #516

Closed

Description

@kyoshidajp

Sensitive headers (Authorization and Cookie) are sent to cross-site when redirecting.

For example, an original target URL is http://example.com and redirect to http://example.jp (cross-site). The sample code is the following.

require 'http'

HTTP.headers({Authorization: "Basic xxx", Cookie: "key=value"})
  .follow()
  .get("http://example.com")

This PR might be related to #264.

Activity

  1. sferik commented on Mar 11, 2026

    @sferik
    Contributor

    This is partially resolved by 6eef4d0, which strips the Authorization header on cross-origin redirects but not cookies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions