The new endpoint does show up in the Admin interface, but when trying to access it, I get a 404 response for both localhost:5000/foo/bar and localhost:5000/foo/bar/subpath
In Windows eventlogs, I do not see any useful error I can troubleshoot with. What am I doing wrong?
Here’s how I’m calling and validating them. Notice that the subpath contains the forward slash.
It "should work with regex with params" {
Invoke-RestMethod http://localhost:5000/foo/bar/subpath | Should -Be "/subpath"
}
It "should work with regex" {
Invoke-RestMethod http://localhost:5000/regex/works | Should -Be "regex"
}
2021-11-22 07:59:32.751 +00:00 [DBG] Adding endpoint: (GET) ^\/foo\/bar(?<format>\/subpath|)
2021-11-22 08:00:03.213 +00:00 [INF] Starting groom job.
2021-11-22 08:00:03.221 +00:00 [INF] Groom date is: 10/23/2021 8:00:03 AM
2021-11-22 08:00:03.225 +00:00 [INF] Old jobs: 0
2021-11-22 08:00:03.230 +00:00 [INF] Finished groom job.
2021-11-22 08:00:47.973 +00:00 [INF] Request starting HTTP/1.1 GET http://localhost:5000/foo/bar - -
2021-11-22 08:00:47.974 +00:00 [DBG] AuthenticationScheme: Negotiate was not authenticated.
2021-11-22 08:00:47.974 +00:00 [DBG] No response compression available, the Accept-Encoding header is missing or invalid.
2021-11-22 08:00:47.974 +00:00 [DBG] The request path /foo/bar does not match a supported file type
2021-11-22 08:00:47.974 +00:00 [DBG] The request path does not match the path filter
2021-11-22 08:00:47.974 +00:00 [DBG] No candidates found for the request path '/foo/bar'
2021-11-22 08:00:47.974 +00:00 [DBG] Request did not match any endpoints
2021-11-22 08:00:47.976 +00:00 [DBG] The request path /foo/bar does not match a supported file type
2021-11-22 08:00:47.977 +00:00 [DBG] The request path does not match the path filter
2021-11-22 08:00:47.977 +00:00 [DBG] No candidates found for the request path '/foo/bar'
2021-11-22 08:00:47.977 +00:00 [DBG] Request did not match any endpoints
2021-11-22 08:00:47.978 +00:00 [DBG] Connection id "0HMDDHNSKRTJJ" completed keep alive response.
2021-11-22 08:00:47.978 +00:00 [INF] Request finished HTTP/1.1 GET http://localhost:5000/foo/bar - - - 404 0 - 5.0869ms
2021-11-22 08:00:49.452 +00:00 [INF] Request starting HTTP/1.1 GET http://localhost:5000/foo/bar/subpath - -
2021-11-22 08:00:49.452 +00:00 [DBG] AuthenticationScheme: Negotiate was not authenticated.
2021-11-22 08:00:49.452 +00:00 [DBG] No response compression available, the Accept-Encoding header is missing or invalid.
2021-11-22 08:00:49.452 +00:00 [DBG] The request path /foo/bar/subpath does not match a supported file type
2021-11-22 08:00:49.452 +00:00 [DBG] The request path does not match the path filter
2021-11-22 08:00:49.452 +00:00 [DBG] No candidates found for the request path '/foo/bar/subpath'
2021-11-22 08:00:49.452 +00:00 [DBG] Request did not match any endpoints
2021-11-22 08:00:49.454 +00:00 [DBG] The request path /foo/bar/subpath does not match a supported file type
2021-11-22 08:00:49.454 +00:00 [DBG] The request path does not match the path filter
2021-11-22 08:00:49.454 +00:00 [DBG] No candidates found for the request path '/foo/bar/subpath'
2021-11-22 08:00:49.454 +00:00 [DBG] Request did not match any endpoints
2021-11-22 08:00:49.456 +00:00 [DBG] Connection id "0HMDDHNSKRTJJ" completed keep alive response.
2021-11-22 08:00:49.456 +00:00 [INF] Request finished HTTP/1.1 GET http://localhost:5000/foo/bar/subpath - - - 404 0 - 4.2061ms
I don’t notice anything except potentially the authentication method (Windows auth?) that may be different in my environment. Do you have a lot of other endpoints in this environment?
Even when I delete authentication.ps1 and go back to default settings, I still cannot get the regex endpoint to work; the line regarding authentication changes to AuthenticationScheme: Cookies was not authenticated. Rest stays the same.
For what it’s worth, I’m installing PSU through chocolatey (tried 2.5.5 as well) on Windows Server 2019 Standard 1809
Sorry for not replying; I was on vacation for the holidays, and to allow my colleagues to continue working with the configuration, I just duplicated the endpoints to avoid having to use regex at all.
Maybe in the future we’ll work on technical debt and want to retry regex endpoints.