Skip to content

Loading…

404 if I leave a trailing slash in the URI #96

Closed
benjamin-hodgson opened this Issue · 9 comments

3 participants

@benjamin-hodgson

GET /streams/mystream/ returns a 404, whereas /streams/mystream returns a 200 with the correct content. I was not expecting this! :wink:

@gregoryyoung
Event Store member
@benjamin-hodgson

Apologies, I should have been more specific in my reproduction steps. It's a resource identifying an event stream.

Steps to reproduce
1) POST an event to the Event Store to create a stream:

POST http://127.0.0.1:2113/streams/mystream HTTP/1.1
Host: http://127.0.0.1:2113
Content-Type: application/json

[{"eventType": "myEvent", "data": {}, "eventId": "d266c2c4-4afc-429c-a1bd-4f84946541b6"}]

2) Try and GET your new stream with a trailing slash in the URI:

GET http://127.0.0.1:2113/streams/mystream/ HTTP/1.1
Host: http://127.0.0.1:2113
Accept: application/atom+xml

Expected result
A 200 response with the same body as when you GET the resource without the trailing slash

Actual result
A 404 response with no body. You also get a 404 if you attempt to POST to that resource.

Hope this is helpful :smiley:

@gregoryyoung
Event Store member
@jnardiello

Quite an interesting topic. I believe that ES is returning 404 because it expects something connected to a specific event in the stream while you are passing null. I agree that it is confusing but not formally wrong.

@gregoryyoung
Event Store member
@gregoryyoung
Event Store member
@benjamin-hodgson

OK, I understand what's going on, thanks. It was just a surprise to see it!

@gregoryyoung
Event Store member
@gregoryyoung
Event Store member

resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.