Skip to content

Align base64 implementations - #112

Merged
blakeembrey merged 3 commits into
masterfrom
be/align-base64-implementations
Nov 4, 2026
Merged

blakeembrey merged 3 commits into
masterfrom
be/align-base64-implementations

Conversation

@blakeembrey

Copy link
Copy Markdown
Member

Implementing the change requested in #110 and goes further to full coverage.

Based on perf testing and differences in the parsers I opted to support well formed base64 only and reject the invalid base64 padding. No padding remains since both decoders already support it.

Switched to using expect.toEqual for readability in the outputs too, sorry for that noise.

@codecov

codecov Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (0ea09f3) to head (e58e956).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #112   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         3    +1     
  Lines           38        48   +10     
  Branches        10        14    +4     
=========================================
+ Hits            38        48   +10     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread src/index.ts Outdated

const CREDENTIALS_REGEXP =
/^ *(?:[Bb][Aa][Ss][Ii][Cc]) +([A-Za-z0-9._~+/-]+=*) *$/;
const CREDENTIALS_REGEXP = /^ *Basic +([a-z0-9+/]+=*) *$/i;

@blakeembrey blakeembrey Nov 3, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Base64 instead of base68 (which is for other schemes) validation.

@blakeembrey
blakeembrey merged commit 0626a6f into master Nov 4, 2026
10 checks passed
@blakeembrey
blakeembrey deleted the be/align-base64-implementations branch November 4, 2026 17:26
@Phillip9587

Copy link
Copy Markdown
Contributor

Sorry for the late feedback, but wasn’t this a breaking change?

@blakeembrey

Copy link
Copy Markdown
Member Author

Sorry for the late feedback, but wasn’t this a breaking change?

You weren't late, I was just eager.

While it's breaking in the sense that some things worked before on node that won't now, I don't consider it breaking because it improved RFC compliance and fixed bugs in the non-node implementation.

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.

2 participants