Closed
Description
Setup:
I have an InfoController that looks like this:
using System;
using System.Security.Cryptography;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Api.ContractsV1;
namespace Api.Controllers {
[ApiVersion("1.0")]
[Route("/info")]
public class InfoController {
public InfoController(){}
[HttpGet()]
public InfoContract Index() {
return new InfoContract{
Hostname = Environment.MachineName,
};
}
}
}
Here's observed queries, through nginx:
127.0.0.1 - - [25/Nov/2016:21:08:16 +0000] "GET /info HTTP/1.1" 404 0 "-" "curl/7.51.0"
127.0.0.1 - - [25/Nov/2016:21:09:04 +0000] "GET /info?api-version=1.0 HTTP/1.1" 200 31 "-" "curl/7.51.0"
127.0.0.1 - - [25/Nov/2016:21:09:07 +0000] "GET /info?api-version=2.0 HTTP/1.1" 400 192 "-" "curl/7.51.0"
The behavior for missing api-version
query parameter should be the same as if a bad version is specified. I expected the first to result in a 400
as well, rather than 404
.