Use express to not respond to specific browser requests #5069
Unanswered
johann1301s
asked this question in
Q&A
Replies: 2 comments
-
You can try |
Beta Was this translation helpful? Give feedback.
0 replies
-
I don't believe you can "not respond" to the request if the domain name resolves and the request is forwarded to your service. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I would like to serve some HTML based on a normal browser GET request. But I would like to respond with nothing at all, (as though the domain is not even registered) if the user-agent request header contains the string from the js variable
myString
.I think this means that my server must not respond with status 100. But how is this done?
I tried just adding a return statement, which just left the request hanging. I also tried adding res.status(404).end() and res.destroy(), but the result in the browser is different than no response at all.
How can I 'not-respond' to a browser request for a specific user-agent, but otherwise respond normally?
I expected no visible result in the browser at all, as though the domain was not registered.
Beta Was this translation helpful? Give feedback.
All reactions