Skip to content

Instantly share code, notes, and snippets.

@ozten
Created March 9, 2012 17:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ozten/2007673 to your computer and use it in GitHub Desktop.
Save ozten/2007673 to your computer and use it in GitHub Desktop.
Cross Domain Seeding Basic Auth
Goal - to "prime the pump" from dev.clortho.mozilla.org with Basic Auth info for dev.intranet.org,
so the next time a visitor goes to intranet, they will automatically send Basic Auth headers.
====== Via XHR =======
OPTIONS / HTTP/1.1
Host: dev.intranet.org:3667
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:12.0a2) Gecko/20120306 Firefox/12.0a2
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.8,es;q=0.5,it-ch;q=0.3
Accept-Encoding: gzip, deflate
Connection: keep-alive
Origin: https://dev.clortho.mozilla.org
Access-Control-Request-Method: GET
Access-Control-Request-Headers: authorization
HTTP/1.1 200 OK
X-Powered-By: Express
Access-Control-Allow-Origin: https://dev.clortho.mozilla.org
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Authorization
Content-Type: text/html; charset=utf-8
Content-Length: 3
Allow: GET
Connection: keep-alive
GET / HTTP/1.1
Host: dev.intranet.org:3667
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:12.0a2) Gecko/20120306 Firefox/12.0a2
Accept: text/html, */*; q=0.01
Accept-Language: en-us,en;q=0.8,es;q=0.5,it-ch;q=0.3
Accept-Encoding: gzip, deflate
Connection: keep-alive
Authorization: Basic YWtpbsomecrazypasswordvalueherekzcW0=
Origin: https://dev.clortho.mozilla.org
HTTP/1.1 200 OK
X-Powered-By: Express
Access-Control-Allow-Origin: https://dev.clortho.mozilla.org
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Authorization
Content-Type: text/html; charset=utf-8
Content-Length: 5
Connection: keep-alive
Hello
====== Direct browsing =======
GET / HTTP/1.1
Host: dev.intranet.org:3667
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:12.0a2) Gecko/20120306 Firefox/12.0a2
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.8,es;q=0.5,it-ch;q=0.3
Accept-Encoding: gzip, deflate
Connection: keep-alive
===================
Note:
Authorization: Basic YWtpbsomecrazypasswordvalueherekzcW0= header wasn't automatically sent when we browse directly...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment