If you found a bug in the Domino's app, would you eat for free?
If you discovered a bug in the Domino's app that let you order pizza for free, would you take advantage of it? A U.K. man was faced with that conundrum, but opted to take the Good Samaritan route.
In a recent blog post, Paul Price said that three years ago, he was ordering food using the Domino's Android app when he was inspired to dig into the code to figure out how a £10 off voucher code was triggered. After analyzing traffic and realizing that payments were processed on his device and not on a server, he decided to see if he could fiddle with the code and get a free pizza.
Price said he input a fake credit card number, which returned a declined payment notice. However, by changing some values in the traffic from his device to Domino's, he was able to trick the company into believing a payment was approved. Before long, his free pizza was in the works.
"A few minutes pass and the Pizza Tracker changes from 'Order' to 'Prep' and then to 'Baking,'" he said. "I couldn't bear to wait another 30 minutes to see if an Americano pizza, Chicken Strippers and Chocolate Chip Cookie + Ice Cream side turn up at my door. I called the store and they confirm they have received my order and it will be delivered within the next 20 minutes."
Soon after, he said, his order arrived.
Although some may have used the exploit to get free pizza for life, Price decided against it.
"My first thought: awesome. My second thought: s**t," he wrote. "The pizza arrives and I tell the delivery driver there must of been a mistake with the order as I never entered any card details and wanted to pay with cash. He happily leaves with £26 and my conscience is clean."
Domino's has since patched the bug, which is why Price decided to write his post. "Payments are still being processed client side but they now have the proper server side checks in place," he said.
Domino's confirmed to Fortune that the problem has been fixed. As the site noted, this is not the first online ordering mixup for Domino's; the chain accidentally gave away 11,000 free pizzas back in 2009.
This article originally appeared on PCMag.com.