This repository was archived by the owner on Aug 22, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -10,4 +10,6 @@ AIR_TABLE_API_KEY=<your_key> ./airtable-api-proxy
10
10
```
11
11
12
12
## Docker
13
- WIP.
13
+ ``` bash
14
+ docker run -p 4242:4242 hookactions/airtable-api-proxy
15
+ ```
Original file line number Diff line number Diff line change @@ -19,11 +19,13 @@ type transport struct {
19
19
apiKey string
20
20
}
21
21
22
- func (t * transport ) RoundTrip (r * http.Request ) (* http.Response , error ) {
23
- log .Printf ("Sending request to %q" , r .URL .String ())
22
+ func (t * transport ) RoundTrip (r * http.Request ) (* http.Response , error ) {
23
+ log .Printf ("Sending request, %s %s" , r .Method , r .URL .String ())
24
+
24
25
r .Host = r .URL .Host
25
26
r .Header .Set ("Authorization" , fmt .Sprintf ("Bearer %s" , t .apiKey ))
26
27
r .Header .Del ("X-Forwarded-For" )
28
+
27
29
return http .DefaultTransport .RoundTrip (r )
28
30
}
29
31
@@ -48,7 +50,7 @@ func main() {
48
50
airTableApiKey := os .Getenv ("AIR_TABLE_API_KEY" )
49
51
50
52
router := mux .NewRouter ()
51
- router .HandleFunc ("/{version}/{app}/{resource}" , newProxyHandler (airTableApiKey )).Methods ("POST" )
53
+ router .HandleFunc ("/{version}/{app}/{resource}" , newProxyHandler (airTableApiKey )).Methods ("POST" , "OPTIONS" )
52
54
53
55
srv := & http.Server {
54
56
Handler : router ,
You can’t perform that action at this time.
0 commit comments