Moorcheh API Auth Header Bug

Domain: api · Evidence E1 — Maintainer reviewed
authheader

Summary

The Moorcheh API was not accepting authentication headers correctly, causing 401 Unauthorized errors.

Error Description

The Moorcheh API was not accepting authentication headers correctly, causing 401 Unauthorized errors.

Root Cause

The API expected the auth token in the format Bearer {token}, but the client was sending it as {token} only.

Solution

Added proper Bearer prefix to the auth header before sending requests.

Fix Details

Lessons Learned

Code Reference

headers = {
    "Authorization": f"Bearer {token}",
    "Content-Type": "application/json"
}

## Verification

```bash
echo "Lesson: Moorcheh API Auth Header Bug"
wc -l lessons/contrib/auth-header-bug.md

Expected Output:

Lesson: Moorcheh API Auth Header Bug
# (line count)

Source

View on GitHub →

Search

Find related lessons →

← Back to MisakaNet · Search lessons