Skip to content

Probe empty HTTP header names and stream writes - #1424

Open
bstaeheli wants to merge 4 commits into
aldevtools:masterfrom
bstaeheli:probe-http-header-7870
Open

bstaeheli wants to merge 4 commits into
aldevtools:masterfrom
bstaeheli:probe-http-header-7870

Conversation

@bstaeheli

@bstaeheli bstaeheli commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

What this PR adds or changes

Probe empty header-name lookups and stream writes after content-header changes, including copies and response content.

Linked issue

n/a

Related runtime pull request: aldevtools/BusinessCentral.AL.Runner#7870.

Test area(s)

http and http/content.

Local validation of the added neutral probes:

  • BC 27.5.46862.58266: passed.
  • BC 28.5.54151.54753: passed.
  • BC 29.1.57326.58275: passed.

The isolated app was compiled with Compile-AppInBcContainer against each version and run with:

Run-TestsInBcContainer -containerName $container -credential $cred -companyName $company -extensionId $appId -testCodeunitRange '72020|72022' -testCodeunit '*' -testFunction 'Http*' -XUnitResultFileName $resultFile -culture en-US -interactionTimeout ([timespan]::FromMinutes(10)) -detailed -returnTrueIfAllPassed — passed on all three.

The pull request's BC 27.5, 28.5 and 29.0 CI matrix is awaiting maintainer approval; BC 29.1 is not a substitute for its 29.0 result.

Checklist

  • Initialize() is the first line of every [Test] procedure
  • Initialize() calls DeleteAll() on every table used in the codeunit
  • Shared _fixtures/ objects used; each local object has a // local object: <reason> line
  • New files are in <area>/<topic>/ (no writer id, issue number or batch name in a folder name)
  • New tests are at the end of the topic's existing codeunit; no codeunit renumbered, no test or must-not-compile case renamed
  • A removed or merged test has a line in tests/rename-map.tsv
  • Test name uniquely identifies the claim without reading the body (Type_Method_Scenario_Outcome)
  • Doc-link comment block is present at the top of each new file
  • Out-of-scope tests are in the area of the feature and confirm the error only
  • Version-gated code uses #if BC28PLUS (or equivalent) with an explanatory comment
  • CI passes on this pull request (all required checks: BC 27.5, 28.5 and 29.0)

The checklist applies to the added tests; no persistent tables, local objects, new files, removals, or new version gates were introduced.

bstaeheli and others added 2 commits November 16, 2026 11:52
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bstaeheli

Copy link
Copy Markdown
Contributor Author

The automatically triggered probe workflow is awaiting action: https://github.com/aldevtools/BusinessCentral.AL.Language.Tests/actions/runs/43853337364. A maintainer needs to approve it before its BC results can be pinned.

bstaeheli added a commit to bstaeheli/BusinessCentral.AL.Runner that referenced this pull request Nov 16, 2026
Preserve header state across copies and refuse unmeasured shapes. Record the local BC evidence until the probe is pinned.

Refs aldevtools/BusinessCentral.AL.Language.Tests#1424

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bstaeheli
bstaeheli marked this pull request as ready for review November 16, 2026 13:41
Copilot AI balanced review requested due to automatic review settings November 16, 2026 13:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Test coverage omits key stream/header-state combinations, direct request-content stream writes, and empty-name checks on request/response content headers, leaving receiver-specific regressions insufficiently guarded against.

3 open issues
What changed in this PR

This PR extends the AL HTTP behavioral tests to probe empty header-name lookups and stream writes after content-header changes.

Changes:

  • Adds HttpHeaders.Contains('') error assertions across several receivers and secret-value scenarios.
  • Tests stream-write body and Content-Type outcomes after header removal, re-addition, clearing, and content resets.
  • Covers content copies, request-assigned copies, and direct response-content writes.
File Description
tests/​al-language/​http/​HttpHeaders.al Adds empty-name lookup probes and shared error expectations.
tests/​al-language/​http/​content/​HttpContent.al Adds stream-write scenarios for header changes, copies, and response content.

Review effort: Balanced

Comment thread tests/al-language/http/HttpHeaders.al Resolved
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@StefanMaron

Copy link
Copy Markdown
Collaborator

I review the probe first. The CI run on BC 27.5, 28.5 and 29.0 waits for my approval to run. The automated review comments are suggestions; in my review I will say which of them I need for the runtime change in runner#7870.

@StefanMaron

Copy link
Copy Markdown
Collaborator

Thanks for the probe. Your new tests passed on all three legs. The red legs come from a test that this pull request does not change.

Failing test: InvalidNames in codeunit 72022 "LT HtT Headers Errors" (tests/al-language/http/HttpHeaders.al), on BC 28.5. On BC 27.5 the same calls run as PW_InvalidNames_Bc27.

  • Observed: blankName|code = InvalidHeader:Format
  • Asserted: blankName|code = InvalidHeader:Argument
  • Builds: 27.5.54899.58715 and 28.5.54976.58720. BC 29.0 passed.

Microsoft republished BC 27.5 and 28.5 on .NET 10. Corpus CI takes the newest build, and on those builds Headers.Add(' ', 'v') gives the Format code, as BC 29 already did. Master holds both values since the merged pull request "Fix master: hold both values where the .NET 10 builds of BC 27.5 and 28.5 changed a fact" (#1434). It uses PlatformBuild.IsNet10Build() for this.

Please merge master into your branch. It merges without conflicts. The next CI run should then be green.

Generated by an AI agent (Claude) working for Stefan Maron.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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