bacondropped@bacontop~> curl -H 'Accept: text/plain' http://www.foaas.com/back/Sir/I -vv
* Trying 104.31.79.186...
* Connected to www.foaas.com (104.31.79.186) port 80 (#0)
> GET /back/Sir/I HTTP/1.1
> Host: www.foaas.com
> User-Agent: curl/7.47.0
> Accept: text/plain
>
< HTTP/1.1 200 OK
< Date: Tue, 21 Jun 2016 14:03:41 GMT
< Content-Type: text/plain; charset=utf-8
< Content-Length: 27
< Connection: keep-alive
< Set-Cookie: __cfduid=d78a8a5fffeed8ed5944884d93321973d1466517820; expires=Wed, 21-Jun-17 14:03:40 GMT; path=/; domain=.foaas.com; HttpOnly
< X-Powered-By: Express
< X-Clacks-Overhead: GNU Terry Pratchett
< Set-Cookie: i18next=dev; path=/; expires=Wed, 21 Jun 2017 14:03:41 GMT
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Methods: GET, OPTIONS
< Access-Control-Allow-Headers: Content-Type
< Etag: W/"1b-3nlA/KrpvegVP+fNIFiSOg"
< Via: 1.1 vegur
< Server: cloudflare-nginx
< CF-RAY: 2b68015d144c4e48-DME
<
* Connection #0 to host www.foaas.com left intact
Sir, back the fuck off. - I⏎
bacondropped@bacontop~> curl -H 'Accept: text/plain' http://www.foaas.com/back/Sir/I\?i18n=ja -vv
* Trying 104.31.79.186...
* Connected to www.foaas.com (104.31.79.186) port 80 (#0)
> GET /back/Sir/I?i18n=ja HTTP/1.1
> Host: www.foaas.com
> User-Agent: curl/7.47.0
> Accept: text/plain
>
< HTTP/1.1 200 OK
< Date: Tue, 21 Jun 2016 14:04:03 GMT
< Content-Type: text/plain; charset=utf-8
< Content-Length: 54
< Connection: keep-alive
< Set-Cookie: __cfduid=d2024289d6f0895b68000f492f5791ff71466517843; expires=Wed, 21-Jun-17 14:04:03 GMT; path=/; domain=.foaas.com; HttpOnly
< X-Powered-By: Express
< X-Clacks-Overhead: GNU Terry Pratchett
< Set-Cookie: i18next=dev; path=/; expires=Wed, 21 Jun 2017 14:04:03 GMT
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Methods: GET, OPTIONS
< Access-Control-Allow-Headers: Content-Type
< Etag: W/"36-pBDiKY4XNamEPtq2uCyanA"
< Via: 1.1 vegur
< Server: cloudflare-nginx
< CF-RAY: 2b6801e7569c4e60-DME
<
* Connection #0 to host www.foaas.com left intact
サー、性交をバックオフにします。 ●⏎
bacondropped@bacontop~> curl -H 'Accept: text/plain' http://www.foaas.com/back/Sir/I\?i18n -vv
* Trying 104.31.79.186...
* Connected to www.foaas.com (104.31.79.186) port 80 (#0)
> GET /back/Sir/I?i18n HTTP/1.1
> Host: www.foaas.com
> User-Agent: curl/7.47.0
> Accept: text/plain
>
< HTTP/1.1 200 OK
< Date: Tue, 21 Jun 2016 14:04:31 GMT
< Content-Type: text/plain; charset=utf-8
< Content-Length: 175
< Connection: keep-alive
< Set-Cookie: __cfduid=d11dc779660ac0fc00c2a5cfe696b421a1466517870; expires=Wed, 21-Jun-17 14:04:30 GMT; path=/; domain=.foaas.com; HttpOnly
< X-Powered-By: Express
< X-Clacks-Overhead: GNU Terry Pratchett
< Set-Cookie: i18next=dev; path=/; expires=Wed, 21 Jun 2017 14:04:31 GMT
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Methods: GET, OPTIONS
< Access-Control-Allow-Headers: Content-Type
< Etag: W/"af-zRPh9T1DZO8Nj9NWMVfmag"
< Via: 1.1 vegur
< Server: cloudflare-nginx
< CF-RAY: 2b680294b5454ef6-DME
<
* Connection #0 to host www.foaas.com left intact
'DEV' IS AN INVALID TARGET LANGUAGE . EXAMPLE: LANGPAIR=EN|IT USING 2 LETTER ISO OR RFC3066 LIKE ZH-CN. ALMOST ALL LANGUAGES SUPPORTED BUT SOME MAY HAVE NO CONTENT undefined⏎
Since curl does not send the Accept-Language header, the failure is ok. However, I think it would be robust to fall back to a default behavior in this case, for instance, refusing to translate and sending the string in English instead.
Example below:
Since curl does not send the Accept-Language header, the failure is ok. However, I think it would be robust to fall back to a default behavior in this case, for instance, refusing to translate and sending the string in English instead.
Thoughts?