@@ -1921,6 +1921,13 @@ func TestDoGetFallback(t *testing.T) {
19211921
19221922 body , _ := json .Marshal (apiResp )
19231923
1924+ if req .Method == http .MethodPost {
1925+ if req .URL .Path == "/blockPost403" {
1926+ http .Error (w , string (body ), http .StatusForbidden )
1927+ return
1928+ }
1929+ }
1930+
19241931 if req .Method == http .MethodPost {
19251932 if req .URL .Path == "/blockPost405" {
19261933 http .Error (w , string (body ), http .StatusMethodNotAllowed )
@@ -1965,6 +1972,22 @@ func TestDoGetFallback(t *testing.T) {
19651972 t .Fatalf ("Mismatch in values" )
19661973 }
19671974
1975+ // Do a fallback to a get on 403.
1976+ u .Path = "/blockPost403"
1977+ _ , b , _ , err = api .DoGetFallback (context .TODO (), u , v )
1978+ if err != nil {
1979+ t .Fatalf ("Error doing local request: %v" , err )
1980+ }
1981+ if err := json .Unmarshal (b , resp ); err != nil {
1982+ t .Fatal (err )
1983+ }
1984+ if resp .Method != http .MethodGet {
1985+ t .Fatalf ("Mismatch method" )
1986+ }
1987+ if resp .Values != v .Encode () {
1988+ t .Fatalf ("Mismatch in values" )
1989+ }
1990+
19681991 // Do a fallback to a get on 405.
19691992 u .Path = "/blockPost405"
19701993 _ , b , _ , err = api .DoGetFallback (context .TODO (), u , v )
0 commit comments