This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as AWS from 'aws-sdk' | |
AWS.HttpClient.prototype.handleRequest = function handleRequest(httpRequest, httpOptions, callback, errCallback) { | |
var self = this; | |
var endpoint = httpRequest.endpoint; | |
var emitter = new EventEmitter(); | |
callback(emitter); | |
var href = endpoint.protocol + '//' + endpoint.hostname; | |
if (endpoint.port !== 80 && endpoint.port !== 443) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import proxy from "@fly/proxy" | |
import { forceSSL } from './lib/utilities' | |
const origin = proxy("https://viaglamour.com/") | |
/** | |
* Rewrite the path to /store/<hostname> | |
*/ | |
function rewriteRequest(req) { | |
const url = new URL(req.url) | |
let path = "/store/" + url.hostname.replace(/\.[a-z]+/, '') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dist | |
lib | |
build | |
node_modules | |
.nyc_output | |
bin/fly | |
.fly | |
package-lock.json | |
yarn.lock |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "ipaddr" | |
require "net/http" | |
require "uri" | |
require "json" | |
def fetch(uri_str, limit = 10) | |
# You should choose better exception. | |
raise ArgumentError, "HTTP redirect too deep" if limit == 0 | |
url = URI.parse(uri_str) |
OlderNewer