use of com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueAddRequest.Header in project appengine-java-standard by GoogleCloudPlatform.
the class DevQueueIntegrationTest method testAddTaskIgnoresNonLocalhostHostHeader.
@Test
public void testAddTaskIgnoresNonLocalhostHostHeader() throws Exception {
// schedule way in the past
TaskQueueAddRequest.Builder add = newAddRequest(1000);
Header header = TaskQueueAddRequest.Header.newBuilder().setKey(ByteString.copyFromUtf8("Host")).setValue(ByteString.copyFromUtf8("foo:8085")).build();
add.addHeader(header);
TaskQueueAddResponse response = queue.add(add);
waitForJobExecution();
assertThat(providedFetchReqs).hasSize(1);
assertFetchReqEquals(providedFetchReqs.get(0), URLFetchRequest.RequestMethod.GET, "http://localhost:8080/my/url", false, 0, response.getChosenTaskName().toStringUtf8(), 0);
}
use of com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueAddRequest.Header in project appengine-java-standard by GoogleCloudPlatform.
the class DevQueueIntegrationTest method testAddTaskRespectsHostHeader.
@Test
public void testAddTaskRespectsHostHeader() throws Exception {
// schedule way in the past
TaskQueueAddRequest.Builder add = newAddRequest(1000);
Header header = TaskQueueAddRequest.Header.newBuilder().setKey(ByteString.copyFromUtf8("Host")).setValue(ByteString.copyFromUtf8("localhost:24358")).build();
add.addHeader(header);
TaskQueueAddResponse response = queue.add(add);
waitForJobExecution();
assertThat(providedFetchReqs).hasSize(1);
assertFetchReqEquals(providedFetchReqs.get(0), URLFetchRequest.RequestMethod.GET, "http://localhost:24358/my/url", false, 0, response.getChosenTaskName().toStringUtf8(), 0);
}
Aggregations