Skip to content

Handle URL-encoded linkType in Location header and unexpected 300 responses#26

Open
rmedic wants to merge 1 commit into
gs1:masterfrom
rmedic:fix/js-linktype-handling
Open

Handle URL-encoded linkType in Location header and unexpected 300 responses#26
rmedic wants to merge 1 commit into
gs1:masterfrom
rmedic:fix/js-linktype-handling

Conversation

@rmedic
Copy link
Copy Markdown

@rmedic rmedic commented Apr 14, 2026

Two fixes in testMultipleLinks:

  1. The stripping logic for linkType in the redirect Location header only checked for the unencoded form (e.g. gs1:pip). When a resolver echoes the linkType back URL-encoded (gs1%3Apip), the check failed and the parameter was not stripped before comparison. Now checks both encoded and unencoded forms.

  2. When a resolver returns 300 Multiple Choices for a link type that the test expected to redirect (not in threehundredLinks), the test silently failed with no explanation. Now surfaces this as a warn with a message indicating the resolver returned 300 and verification was not possible.

…ponses

Two fixes in testMultipleLinks:

1. The stripping logic for linkType in the redirect Location header only
   checked for the unencoded form (e.g. gs1:pip). When a resolver echoes
   the linkType back URL-encoded (gs1%3Apip), the check failed and the
   parameter was not stripped before comparison. Now checks both encoded
   and unencoded forms.

2. When a resolver returns 300 Multiple Choices for a link type that the
   test expected to redirect (not in threehundredLinks), the test silently
   failed with no explanation. Now surfaces this as a warn with a message
   indicating the resolver returned 300 and verification was not possible.
@philarcher
Copy link
Copy Markdown
Member

Thanks @rmedic for this and the other PRs. I'll dedicate some time to this as soon as I can but please be patient. It won't be before the end of the month due to other commitments and travel.

@sboeckelmann
Copy link
Copy Markdown
Contributor

@philarcher pinging back here as well ;-) Would be cool to get these MRs accepted and deployed.
Thank you @rmedic for providing these fixes!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants