HTTPS Local Network No Content Case
I have an AspNetCore HttpGet Api that returns
NoContent
; is a simple Api for registering an number to the server.
I also have other HttpGet Api that returns contents.
37 Replies
well you should not be using GET for mutating data, anyway.
..and then you'd just respond with 200 (ok) / 201 (created), not 204.
I mean is this a common issue with https and no content on the same machine? Or is it a possible configuration issue that action can be taken to resolve it but not evading it?
no. the https issue is that you're using an SSL cert and the machine doesn't trust it.
either switch to serving http for localhost, or make the browser trust the cert you're using
So if you look at my case 1 and 2 is kind of different
case one does not even have an option to trust
but case 2 does
case 1 likely has this proceed button, too, if you expand the details. chrome likes to hide that option because well, it is a security risk.
no
case 2 has it but it is hided also
so I am aware of the option to show it
are you sending HSTS headers or anything?
I believe not
(it should tell you about that in the details screen where the proceed button would normally be)
let me provide a screenshot instead
This is the error of case 1
this is what I mean by case 2
looks like you're running on http, not https
The reason of you getting this is because there is bodymiddleware
That filters ip
Oh wait
But your http work
But it work on my machine
other than that, press F12, see if the dev console spits out any useful info
so on my machine
this is powershell
add
--head --http2
no problem
so.. working as intended
but this is case 4
where I accessed it through internet
case 1 still has issue
soo.. you're saying there's middleware blocking requests?
are you 100% certain it is not blocking you here?
yeah
so the top is from host machine case 1
the bottom is through internet case 4
the reason I am 100% is not blocking is case 3
where content is loaded
that is a different status code than 204 tho..
the top first command with
verify
is case 1
the top second command with battlecfg
is case 3
the bottom with verify
is case 4https://stackoverflow.com/questions/58215104/whats-the-neterr-http2-protocol-error-about
suggests it may be your web server dropping the connection preemptively under certain circumstances
still.. do me that favor and just switch to not using GET for mutating data. that will possibly fix this issue, and if not, will at least prevent you some future headaches
Yeah
both work of using localhost with nocontent or not using it at all
I was also suggested to have a frontend to handle https
I was just curious is this by design that you cannot access no content httpget api with https and domain name from host machine
because http does work on host machine with no content