Skip to content

Switch to new api.daxformatter.com endpoint and remove redirect handling#23

Merged
albertospelta merged 2 commits into
masterfrom
alberto/patch-service-url
Jun 10, 2026
Merged

Switch to new api.daxformatter.com endpoint and remove redirect handling#23
albertospelta merged 2 commits into
masterfrom
alberto/patch-service-url

Conversation

@albertospelta

Copy link
Copy Markdown
Member

This pull request updates the API endpoints used for formatting requests switching to the new API domain.

API Endpoint Updates

  • Updated the DAX formatter API endpoints in DaxFormatterSingleRequest and DaxFormatterMultipleRequest to use the new https://api.daxformatter.com domain instead of https://www.daxformatter.com.

Refactoring and Simplification

  • Removed the use of semaphores (SemaphoreSlim) and related logic for synchronizing service URI initialization. Now, the service URI is taken directly from the request object.
  • Eliminated custom handling for HTTP redirect status codes, as well as the associated logic for following redirects.
  • Simplified the reading of HTTP responses by removing the use of streams and reading the response content as a string directly.
  • Removed the use of a formatting semaphore to serialize calls to the formatter, allowing concurrent formatting requests.

HTTP Client Handler Change

  • Stopped explicitly disabling auto-redirects in the custom HTTP client handler by removing AllowAutoRedirect = false;.

Update service URIs to use the new API endpoint directly. The old www.daxformatter.com URLs are still online but permanently redirect (301) to the new host. We update the service URIs to point directly to the new endpoint and remove the redirect-resolution machinery that was needed to follow those redirects at runtime.
The _formatSemaphore that serialized all format calls one at a time was originally introduced to guard the redirect-resolution logic. Now that the library calls the stable api.daxformatter.com endpoint directly, there is nothing to serialize: HttpClient is thread-safe by design and concurrent requests are safe.

AllowAutoRedirect is restored to the HttpClientHandler default (true) so any future redirect is followed transparently without custom handling.

ReadAsStringAsync replaces the synchronous StreamReader.ReadToEnd so the response body is read fully asynchronously.
@albertospelta albertospelta marked this pull request as ready for review June 10, 2026 16:25
@albertospelta albertospelta merged commit f47b7e0 into master Jun 10, 2026
1 check passed
@albertospelta albertospelta deleted the alberto/patch-service-url branch June 10, 2026 17:00
albertospelta added a commit to albertospelta/semantic-link-labs that referenced this pull request Jun 11, 2026
Migrate from `daxformatter.azurewebsites.net` to `api.daxformatter.com` as per sql-bi/DaxFormatter#23. The old domain issues permanent 301 redirects to the new host. The new `api.daxformatter.com` domain also drops the `/daxformatter/` segment from the path: `/api/daxformatter/daxtextformatmulti`
albertospelta added a commit to albertospelta/DaxStudio that referenced this pull request Jun 11, 2026
Migrate to api.daxformatter.com and updated path /api/daxtextformat per sql-bi/DaxFormatter#23. Remove the now-obsolete redirect-following and connection-priming code as the new endpoint is the direct API host.
albertospelta added a commit to albertospelta/TabularEditor that referenced this pull request Jun 11, 2026
This pull request updates DaxFormatterProxy to use the new DAX Formatter API endpoint, following the migration in [sql-bi/DaxFormatter#23](sql-bi/DaxFormatter#23).

The service moved from `www.daxformatter.com/api/daxformatter/` to the new official API host `api.daxformatter.com/api/`.  The new `api.daxformatter.com` host is the direct API endpoint and no longer issues a redirect, so all the redirect-following and connection-priming code has been removed.
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.

1 participant