Skip to content

Commit

Permalink
Update not-yet-2024-04-17.md
Browse files Browse the repository at this point in the history
  • Loading branch information
delgreco authored Apr 26, 2024
1 parent 3271d9c commit 9572113
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions _posts/not-yet-2024-04-17.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Debugging API Calls Like A ~~Boss~~ Boob
## Debugging API Calls Like A ~~Boob~~ Boss

Recently, I stood up a simple JSON web service on Apache in my usual way, the basis for an API for new client calls to be expected from a commercial system used in $dayjob.
Recently, I stood up a simple JSON web service on Apache in my usual way, the basis for an API for new client calls to be expected from a commercial system used in $dayjob. Tests of the API with a remote Python script, and by a colleague using Postman, were both successful.

The calls from the commerical system hung. And hung. And finally timed out.

Expand All @@ -16,15 +16,25 @@ sudo tcpdump -i [network interface] -n -t -vv -X -A src [IP address]

... that I was wrong (gasp!): the client call *was* making it to my server. Something *else* had to be hanging things up.

... more exposition ...
Careful of the examination of the headers being sent by the commercial system revealed this guy:

```
Expect: 100-continue
```

I wasn't familiar with this. Developer.mozilla.org says:

>The HTTP 100 Continue informational status response code indicates that everything so far is OK and that the client should continue with the request or ignore it if it is already finished.
Apparently this has wide browser support and is generally not a nuisance. But as it happens, the Microsoft .NET client (making the calls from our commercial system) behaves in a default manner incompatible with Apache's implementation of the 100-continue message (I'm running httpd 2.4.6). This is all immortalized in [the Stack Overflow question](https://stackoverflow.com/questions/3889574/apache-and-mod-proxy-not-handling-http-100-continue-from-client-http-417) where brave developers before me struggled with and finally slew the dragon by applying the hacky strategy of simply stripping the `Expect: 100-continue` header early enough in the request cycle to allow Apache to ignore it:

```
# this was placed in the Apache config file
<IfModule mod_headers.c>
RequestHeader unset Expect early
</IfModule>
```

... conclusions ...
A restart of Apache, and problem solved. But to lose good working hours to what amounts to a lack of cooperation between industry and the open source community is an all too common frustration in this business.



Expand Down

0 comments on commit 9572113

Please sign in to comment.