Skip to content

Conversation

@splitice
Copy link

@splitice splitice commented Aug 24, 2021

  • Compiles
  • Tested
  • Squashed

@splitice splitice mentioned this pull request Aug 24, 2021
@splitice splitice marked this pull request as ready for review September 7, 2021 13:23
@splitice
Copy link
Author

splitice commented Sep 7, 2021

@giom tested.

Valid (simple)

# curl 127.0.0.1 --header 'Accept-Language: zh' -v
* Expire in 0 ms for 6 (transfer 0x55c47f0a5fb0)
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Expire in 200 ms for 4 (transfer 0x55c47f0a5fb0)
* Connected to 127.0.0.1 (127.0.0.1) port 80 (#0)
> GET / HTTP/1.1
> Host: 127.0.0.1
> User-Agent: curl/7.64.0
> Accept: */*
> Accept-Language: zh
>
< HTTP/1.1 302 Moved Temporarily
< Server: nginx/1.21.2
< Date: Tue, 07 Sep 2021 13:19:43 GMT
< Content-Type: text/html
< Content-Length: 145
< Connection: keep-alive
< Location: http://zh.your_domain.com
<
<html>
<head><title>302 Found</title></head>
<body>
<center><h1>302 Found</h1></center>
<hr><center>nginx/1.21.2</center>
</body>
</html>
* Connection #0 to host 127.0.0.1 left intac
# curl 127.0.0.1 --header 'Accept-Language: zh,en' -v
* Expire in 0 ms for 6 (transfer 0x55cfabd08fb0)
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Expire in 200 ms for 4 (transfer 0x55cfabd08fb0)
* Connected to 127.0.0.1 (127.0.0.1) port 80 (#0)
> GET / HTTP/1.1
> Host: 127.0.0.1
> User-Agent: curl/7.64.0
> Accept: */*
> Accept-Language: zh,en
>
< HTTP/1.1 302 Moved Temporarily
< Server: nginx/1.21.2
< Date: Tue, 07 Sep 2021 13:19:36 GMT
< Content-Type: text/html
< Content-Length: 145
< Connection: keep-alive
< Location: http://en.your_domain.com
<

Empty:

# curl 127.0.0.1 --header 'Accept-Language: ' -v
* Expire in 0 ms for 6 (transfer 0x563fc86d2fb0)
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Expire in 200 ms for 4 (transfer 0x563fc86d2fb0)
* Connected to 127.0.0.1 (127.0.0.1) port 80 (#0)
> GET / HTTP/1.1
> Host: 127.0.0.1
> User-Agent: curl/7.64.0
> Accept: */*
>
< HTTP/1.1 302 Moved Temporarily
< Server: nginx/1.21.2
< Date: Tue, 07 Sep 2021 13:11:09 GMT
< Content-Type: text/html
< Content-Length: 145
< Connection: keep-alive
< Location: http://en.your_domain.com
<

Looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant