[Bug]: tsp-spector returns different values for pageables and LROs on Windows and Linux
- Dominant language
- TypeScript
- Stars
- 27
- Forks
- 90
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 156
Description
### Describe the bug
On Windows, next page link is returned as `http://localhost:3000/.../.../`. On Linux, the same link is `http://localhost/.../.../`.
On both OSes, server does indeed run on port 3000.
Same for "operation-location" header value for LROs.
That is why when writing tests, we have to add an extra step to modify the actual value to either drop ":3000", or to add it after "localhost", so that we can use the same expected value, and the test would pass when ran on either platform.
### Reproduction
1. `tsp-spector server start ./../../node_modules/@typespec/http-specs/specs ./../../node_modules/@azure-tools/azure-http-specs/specs`
2. `GET http://localhost:3000/payload/pageable/server-driven-pagination/link HTTP/1.1` - see the value of "next" in the response body.
It repros for every nextPage link or LRO, no need to look into that specific one.
### Checklist
- [x] Follow our [Code of Conduct](https://github.com/azure/typespec-azure/blob/main/CODE_OF_CONDUCT.md)
- [x] Check that this issue is about the Azure libraries for typespec. For bug in the typespec language or core libraries file it in the [TypeSpec repo](https://github.com/Microsoft/TypeSpec/issues/new/choose)
- [x] Check that there isn't already an issue that request the same bug to avoid creating a duplicate.
- [x] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.
Contributor guide
Research direction
Start by running the provided `tsp-spector server start` command and the pageable reproduction on both Windows and Linux. Compare the `next` response value and the LRO `operation-location` header, then trace the tsp-spector server's URL construction. Done means both platforms return equivalent localhost URLs including port 3000, with the relevant tests passing consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- testing, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100