Browse Source

Fix base64 encoding to keep padding for Go URLEncoding (v0.39.3)

- Remove padding stripping from URL-safe base64 conversion
- Go's base64.URLEncoding expects padding characters
- Fix applied to LogView.svelte, BlossomView.svelte, and api.js

Files modified:
- app/web/src/LogView.svelte: Keep padding in auth header
- app/web/src/BlossomView.svelte: Keep padding in auth header
- app/web/src/api.js: Keep padding in auth header
- pkg/version/version: Bump to v0.39.3

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
main
mleku 2 weeks ago
parent
commit
2aa5c16311
No known key found for this signature in database
  1. 2
      app/web/dist/bundle.js
  2. 2
      app/web/dist/bundle.js.map
  3. 4
      app/web/src/BlossomView.svelte
  4. 4
      app/web/src/LogView.svelte
  5. 4
      app/web/src/api.js
  6. 2
      pkg/version/version

2
app/web/dist/bundle.js vendored

File diff suppressed because one or more lines are too long

2
app/web/dist/bundle.js.map vendored

File diff suppressed because one or more lines are too long

4
app/web/src/BlossomView.svelte

@ -76,8 +76,8 @@
}; };
const signedEvent = await signer.signEvent(authEvent); const signedEvent = await signer.signEvent(authEvent);
// Use URL-safe base64 encoding // Use URL-safe base64 encoding (replace + with -, / with _)
return btoa(JSON.stringify(signedEvent)).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, ''); return btoa(JSON.stringify(signedEvent)).replace(/\+/g, '-').replace(/\//g, '_');
} catch (err) { } catch (err) {
console.error("Error creating Blossom auth:", err); console.error("Error creating Blossom auth:", err);
return null; return null;

4
app/web/src/LogView.svelte

@ -75,8 +75,8 @@
}; };
const signedEvent = await userSigner.signEvent(authEvent); const signedEvent = await userSigner.signEvent(authEvent);
// Use URL-safe base64 encoding (replace + with -, / with _, remove padding) // Use URL-safe base64 encoding (replace + with -, / with _)
return btoa(JSON.stringify(signedEvent)).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, ''); return btoa(JSON.stringify(signedEvent)).replace(/\+/g, '-').replace(/\//g, '_');
} catch (err) { } catch (err) {
console.error("Error creating auth header:", err); console.error("Error creating auth header:", err);
return null; return null;

4
app/web/src/api.js

@ -30,8 +30,8 @@ export async function createNIP98Auth(signer, pubkey, method, url) {
// Sign using the signer // Sign using the signer
const signedEvent = await signer.signEvent(authEvent); const signedEvent = await signer.signEvent(authEvent);
// Use URL-safe base64 encoding // Use URL-safe base64 encoding (replace + with -, / with _)
return btoa(JSON.stringify(signedEvent)).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, ''); return btoa(JSON.stringify(signedEvent)).replace(/\+/g, '-').replace(/\//g, '_');
} catch (error) { } catch (error) {
console.error("Error creating NIP-98 auth:", error); console.error("Error creating NIP-98 auth:", error);
return null; return null;

2
pkg/version/version

@ -1 +1 @@
v0.39.2 v0.39.3

Loading…
Cancel
Save