GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Option to use "Location:" header value verbatim for redirection · Issue #864 · googleapis/google-http-java-client

Option to use "Location:" header value verbatim for redirection #864

New issue
Copy link
New issue
Copy link
Closed
#871
Closed
Option to use "Location:" header value verbatim for redirection#864
#871
Copy link
Assignees
codyoss
Labels
type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Description

@chanseokoh
chanseokoh
opened on Oct 30, 2019
Issue body actions

Is your feature request related to a problem? Please describe.
There have been problems with interacting Azure Container Registry, OpenShift Container Registry, and Red Hat Quay, where these servers return a redirect location (the Location: header value) but they fail to honor a redirect URL if it doesn't match the original URL value char-by-char.

(FYI, the ACR issue has been taken care of by setting setNormalizeUri(false) on Apache HttpClient. However, Microsoft should fix their servers eventually.)

Examples:

  • Microsoft: After upgrading to 1.31.0, library returns 403 while curl succeeds #795 (comment)
  • Red Hat: Fails to pull image from registry - registry.redhat.io GoogleContainerTools/jib#2106 (comment)
  • Red Hat: https://groups.google.com/d/msg/quay-sig/2y7tMP0h0g0/IMUQyDDpAgAJ
  • Red Hat: Images created by Jib randomly causes 500 Internal server error in Red Hat Quay GoogleContainerTools/jib#1986 (comment)

Describe the solution you'd like
As described in #795 (comment), an option to take the Location: URL value and use it verbatim, without ever modifying any character.

Describe alternatives you've considered
Wait for Red Hat to fix their servers, which they said won't likely happen for a very long time.

Additional context
Fixing this may first require enhancing GenericUrl to disable encoding and decoding (but I am not sure).

Activity

  1. iocanel commented on Oct 31, 2019

    @iocanel
    iocanel
    on Oct 31, 2019
    Contributor
    More actions

    @chanseokoh: Getting the Location: and using it as is, doesn't seem very hard to implement, does this also require additional work in httpcomponents-client side?

  2. chanseokoh commented on Oct 31, 2019

    @chanseokoh
    chanseokoh
    on Oct 31, 2019
    ContributorAuthor
    More actions

    I quickly hacked GenericUrl and tried a call to see if the server side can get the URL as-is, and it seems to get it as-is. This library sets setNormalizeUri(false) on the Apache library, so perhaps the Apache library does not mangle with it either.

    Implenenting this feature may not be terribly difficult, but it may need cascading changes to GenericUrl, UrlEncodedParser and some others, I don't know. And since the API is GA and public, I see such changes cannot be taken lightly.

  3. iocanel commented on Oct 31, 2019

    @iocanel
    iocanel
    on Oct 31, 2019
    Contributor
    More actions

    @chanseokoh: I've started working on a pull request (modifying GenericUrl and UrlEncodedParser).
    Please let me know if I should continue, or if you are going to pick this up.

  4. chanseokoh commented on Oct 31, 2019

    @chanseokoh
    chanseokoh
    on Oct 31, 2019
    ContributorAuthor
    More actions

    Wonderful! You can continue on this, thanks a ton. And note that I believe this library has an automatic redirection handling (the user does not have to parse Location: and make another redirect call themselves), so make sure that is taken care of too. Or perhaps, you just take care of that execution path only, without making this URL-pass-through general for any calls. I am not sure.

  5. yoshi-automation
    added
    triage meI really want to be triaged.
    🚨This issue needs some love.
    on Oct 31, 2019
  6. codyoss
    added
    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
    and removed
    🚨This issue needs some love.
    triage meI really want to be triaged.
    on Nov 5, 2019
  7. codyoss
    closed this as completedin #871on Nov 20, 2019
  8. JustinBeckwith
    assigned
    codyoss
    on Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @codyoss
    codyoss

Labels

type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.