1

I've got a project that has an interesting scenario.

I've got to deploy a SOAP service (using soap core) into the environment, and it has to allow http-- the client app consuming it is old, already compiled, and wont' work with https (i tried).

however, I want literally EVERYTHING else http only, not https.

so I'm looking for a specific route: myservice/theservice.asmx to allow HTTPS, and everything else not so much.

I'm deployed into a windows appservice.

I could split this soap service out into another app service if I had to, but I would prefer to not.

Is there any way to accomplish this?

2 Answers 2

1

I found an answer to my own question:

  app.UseWhen(httpContext => !httpContext.Request.Path.StartsWithSegments("/pga4"),
                subApp => subApp.UseHttpsRedirection());

this allows you to conditionally apply middleware based on path.
(subApp acts same as app.Usexxx(), but only in this conditional context).

Hope this helps.

Sign up to request clarification or add additional context in comments.

Comments

0

You could use an HttpInterceptor to filter and fix each http/s request that gets sent out?

A very rough example:

import { Injectable } from '@angular/core';
import {
  HttpRequest,
  HttpHandler,
  HttpEvent,
  HttpInterceptor
} from '@angular/common/http';

@Injectable()
export class ServiceInterceptor implements HttpInterceptor {
  intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
    if (request.url.match(/myservice\/theservice\.asmx$/)) {
      request = request.clone({
        url: request.url.replace('https:', 'http:')
      });
    }
    return next.handle(request);
  }
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.