Home > Net >  Request. The requested Url domain Host replacement head
Request. The requested Url domain Host replacement head

Time:10-08

Sends a Request, set in the Host field of the Request header after other domain name, with the Request. Access to the Url link to set the domain name into the Host field in the domain name, and do not have this problem in the local development, which is published to the server, this is how to return a responsibility, how should solve?

CodePudding user response:

I remember the Host field, it is by the browser automatically and you can't change

CodePudding user response:

The
refer to the original poster togamilight response:
sends a Request, set in the Host field of the Request header after other domain name, with the Request. Access to the Url link to set the domain name into the Host field in the domain name, and do not have this problem in the local development, which is published to the server, this is how to return a responsibility, how should solve?


The Request object is a collection of user requests, you tell me how to modify the user you want to ask? That is the user request arrival you summed up on the server after the server request object,

CodePudding user response:

refer to the second floor fat uncle write code reply:
Quote: refer to the original poster togamilight response:

Sends a Request, set in the Host field of the Request header after other domain name, with the Request. Access to the Url link to set the domain name into the Host field in the domain name, and do not have this problem in the local development, which is published to the server, this is how to return a responsibility, how should solve?


The Request object is a collection of user requests, you tell me how to modify the user you want to ask? Is that a user request arrival you summed up on the server after the server request object,


Not that I want to modify the user Request, I mean, if someone malicious Request, he changed the Host field, I want to use the Request on the server. The Url for the current domain, will get him set the Host, rather than the domain name Request itself, I want to know why this is so, how to get the right domain name

Request to this address, for example, www.xxx.com/a, and then request header Host www.yyy.com; instead
And call Request on the server. The Url, www.yyy.com/a

CodePudding user response:

reference 1st floor q363186 response:
, I remember the Host field is by the browser automatically and you can't change


Request is not necessarily the browser hair, with a postman, or write a program to send, want to change anything

CodePudding user response:

Togamilight
reference 4 floor response:
Quote: refer to 1st floor q363186 response:

I remember the Host field, is by the browser automatically and you can't change


Request is not necessarily the browser hair, with a postman, or write a program to send, want to change anything.
did you try to change you can receive the request?

CodePudding user response:

fat uncle write code references 5 floor response:
Quote: refer to 4th floor togamilight response:

Quote: refer to 1st floor q363186 response:

I remember the Host field, is by the browser automatically and you can't change


Request is not necessarily the browser hair, with a postman, or write a program to send, want to change anything.
did you try to change you can receive the request?

Try, otherwise why would I have this problem,,,

CodePudding user response:

refer to 6th floor togamilight response:
Quote: refer to the 5 floor fat uncle write code reply:
Quote: refer to 4th floor togamilight response:

Quote: refer to 1st floor q363186 response:

I remember the Host field, is by the browser automatically and you can't change


Request is not necessarily the browser hair, with a postman, or write a program to send, want to change anything.
did you try to change you can receive the request?

Try, otherwise why would I have this problem,,,

That is targeted at the browser requests, you use httpwebrequest want to send what all can, the head is a collection, hair what casual, just the browser limit for you a field, or else how can appear requests can be forged, so you don't depend too much on these things

CodePudding user response:

refer to 7th floor q363186 response:
Quote: refer to the sixth floor togamilight response:

Quote: refer to the 5 floor fat uncle write code reply:
Quote: refer to 4th floor togamilight response:

Quote: refer to 1st floor q363186 response:

I remember the Host field, is by the browser automatically and you can't change


Request is not necessarily the browser hair, with a postman, or write a program to send, want to change anything.
did you try to change you can receive the request?

Try, otherwise why would I have this problem,,,

That is targeted at the browser requests, you use httpwebrequest want to send what all can, the head is a collection, hair what casual, just the browser limit for you a field, or else how can appear requests can be forged, so you don't depend too much on these things

I didn't rely on the Host field, on the contrary I want to ignore it, I'd like to Request the Url for the current Request of domain names, but always get the domain name of the Host field, I want to know what method can accurately, to get the current Request domain name

CodePudding user response:

HttpWebRequest have attributes of the Host,

CodePudding user response:

https://docs.microsoft.com/en-us/dotnet/api/system.net.httpwebrequest.host? View=netframework - 4.7.2 # System_Net_HttpWebRequest_Host

CodePudding user response:





reference togamilight reply: 3/f
Quote: refer to the second floor fat uncle write code reply:

The
Quote: refer to the original poster togamilight response:

Sends a Request, set in the Host field of the Request header after other domain name, with the Request. Access to the Url link to set the domain name into the Host field in the domain name, and do not have this problem in the local development, which is published to the server, this is how to return a responsibility, how should solve?


The Request object is a collection of user requests, you tell me how to modify the user you want to ask? Is that a user request arrival you summed up on the server after the server request object,


Not that I want to modify the user Request, I mean, if someone malicious Request, he changed the Host field, I want to use the Request on the server. The Url for the current domain, will get him set the Host, rather than the domain name Request itself, I want to know why this is so, how to get the right domain name

Request to this address, for example, www.xxx.com/a, and then request header Host www.yyy.com; instead
Then call Request. The server Url, got the www.yyy.com/a





refer to the eighth floor togamilight response:
Quote: refer to 7th floor q363186 response:
Quote: refer to the sixth floor togamilight response:

nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related