Skip to content

Token bug in converter.m #35

Done
Done

Description

@k-deeley

Both the GitHub and GitLab cases pass "" as the default token (lines 21, 25), but the GitHub.m and GitLab.m constructors expect missing to skip authentication. So even when no token env var is set, "" gets sent as the auth header and the API returns 401. The unauthenticated GitHub path should work but can't because of this.

Reproduction Steps:

  1. Install DocMaker v0.8.0 (MATLAB_DocMaker.mltbx from the GitHub release) in MATLAB:
>> matlab.addons.install("MATLAB_DocMaker.mltbx")
  1. Make sure no token is set anywhere:
>> setenv("DOCMAKER_GITLAB_HOSTNAME", "")
>> setenv("DOCMAKER_GITLAB_TOKEN", "")
  1. Minimal repro:
>> setenv("DOCMAKER_CONVERTER", "GitHub")
>> c = docmaker.converter();
>> c.Token % Expected <missing>

ans = 

    ""

>> c.md2xml("# Hello")
Error using docmaker.GitHub/md2xml (line 80)
[HTTP/1.1 401 Unauthorized] Bad credentials

Activity

  1. self-assigned this
    on Oct 21, 2026
  2. added
    bug
    on Oct 21, 2026
  3. added theissue type on Oct 21, 2026
  4. linked a pull request that will close this issue35 token bug in converterm #37on Oct 28, 2026
  5. djmsampson commented on Dec 3, 2026

    @djmsampson
    Collaborator

    Closing as fixed by PR #41. The shared Markdown API converter now adds the Authorization header only when the token is nonempty. With no GitHub token, the request omits that header and can use GitHub’s unauthenticated Markdown endpoint.

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

Metadata

Metadata

Assignees

Labels

bug

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions