Skip to content
This repository has been archived by the owner on Apr 13, 2020. It is now read-only.

Add endpoint restrictions to the documentation #77

Open
camiteca opened this issue Sep 17, 2018 · 5 comments
Open

Add endpoint restrictions to the documentation #77

camiteca opened this issue Sep 17, 2018 · 5 comments
Assignees

Comments

@camiteca
Copy link
Contributor

Hi there,

I was trying to publish beatpulse on IIS. Since I already gave it an application Url (/beatpulse-ui), I didn't need the host to also publish the app under /beatpulse-ui. I tried using string.empty but couldn't publish the app, so I looked into the code and I saw that a "/" was needed instead.

if (string.IsNullOrEmpty(path) || !path.StartsWith("/"))

How would you aproach this? Maybe be permissive and allow string.empty as well as "/"? Or just add a comment on the docs?

Thanks.

@CarlosLanderas
Copy link
Collaborator

To bind middleware into the pipeline the request path has to start with slash. What we can do is allow using string.Empty and internally bind it to "/". Is that what you mean?.

Thanks!

@camiteca
Copy link
Contributor Author

Either that or just adding what you've just commented as part of the docs. :)

@CarlosLanderas
Copy link
Collaborator

I'm gonna bind the string.empty to "/", as it make sense. Thanks @karlmtc ;)

@CarlosLanderas CarlosLanderas self-assigned this Sep 17, 2018
@CarlosLanderas CarlosLanderas added the In Progress Working on the issue label Sep 17, 2018
@camiteca
Copy link
Contributor Author

I'm looking into this and it seems that slash is also not allowed. I'm getting this error:
image

It may be related to this issue: aspnet/HttpAbstractions#683

@CarlosLanderas CarlosLanderas removed the In Progress Working on the issue label Sep 17, 2018
@camiteca
Copy link
Contributor Author

It seems that in order to map a route to '/', you need to just call Run (not Map).

https://docs.microsoft.com/es-es/aspnet/core/fundamentals/middleware/?view=aspnetcore-2.1#use-run-and-map

Does it make sense for you to allow a change on how the Urls are mapped?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants